Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring user_controller separating some classes to service #10384

Conversation

brunnohenrique
Copy link
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Remove some methods at controllers/admin/users_controllers.rb to solve a codeclimate issue: over than 20 methods

Related Tickets & Documents

#3739

Added tests?

  • yes
  • no, because they aren't needed
  • no, because I need help

Added to documentation?

  • docs.forem.com
  • readme
  • no documentation needed

alt_text

@brunnohenrique brunnohenrique requested review from a team and msarit and removed request for a team September 19, 2020 01:13
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Sep 19, 2020
app/services/users/manage_credits.rb Outdated Show resolved Hide resolved
app/services/users/manage_credits.rb Outdated Show resolved Hide resolved
app/services/users/manage_credits.rb Outdated Show resolved Hide resolved
app/services/users/manage_credits.rb Outdated Show resolved Hide resolved
spec/services/users/manage_credits_spec.rb Outdated Show resolved Hide resolved
spec/services/users/manage_credits_spec.rb Outdated Show resolved Hide resolved
spec/services/users/manage_credits_spec.rb Outdated Show resolved Hide resolved
spec/services/users/manage_credits_spec.rb Outdated Show resolved Hide resolved
spec/services/users/manage_credits_spec.rb Outdated Show resolved Hide resolved
spec/services/users/manage_credits_spec.rb Outdated Show resolved Hide resolved
app/controllers/admin/users_controller.rb Outdated Show resolved Hide resolved
app/services/users/manage_credits.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! I think you've addressed all of the requested changes

Thanks @brunnohenrique

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Sep 28, 2020
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Sep 28, 2020
@@ -54,7 +54,7 @@ def remove_org_credits
end

def organization
Organization.find(org_params[:organization_id])
@organization ||= Organization.find(org_params[:organization_id])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an improvement appointed by @jonatasrancan
Ty!

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 5, 2020
@rhymes rhymes merged commit e5973eb into forem:master Oct 5, 2020
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 5, 2020
boardfish pushed a commit to boardfish/forem that referenced this pull request Oct 17, 2020
…#10384)

* Refactoring user_controller separating some classes to service

* Replace service Credit::Manager and improve yours specs

* improve method with memoize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants