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

add interactor for profiles controller #1373

Merged
merged 29 commits into from
Jul 28, 2024

Conversation

tyranja
Copy link
Member

@tyranja tyranja commented Jul 13, 2024

In order to make the code in the controller more readable, I started to use interactors.

I used the interactors to encapsulate logic and move it out of the controller. This has the advantage that it can also be tested separately.

https://github.com/collectiveidea/interactor
https://medium.com/@lucaspolonuer/ruby-on-rails-boost-your-software-design-skills-with-interactors-e07f1f9a711e
https://blog.saeloun.com/2020/05/06/rails-using-interactor-gem/

Copy link
Member

@zaziemo zaziemo left a comment

Choose a reason for hiding this comment

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

I like the interactors and did not know them before :) Let's try it out!
Everything seems to work, I only have some minor improvements and questions.

app/controllers/profiles_controller.rb Show resolved Hide resolved
app/controllers/profiles_controller.rb Outdated Show resolved Hide resolved
app/controllers/profiles_controller.rb Outdated Show resolved Hide resolved
app/interactor/default_search_profiles.rb Outdated Show resolved Hide resolved
Copy link
Member

@zaziemo zaziemo left a comment

Choose a reason for hiding this comment

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

good work :)

app/controllers/profiles_controller.rb Outdated Show resolved Hide resolved
@tyranja tyranja force-pushed the anja-refac-profiles-controller-with-intercator branch 2 times, most recently from bb95b74 to 7b24d5d Compare July 24, 2024 18:01
@tyranja tyranja force-pushed the anja-refac-profiles-controller-with-intercator branch from 7b24d5d to 3351e06 Compare July 26, 2024 09:39
@tyranja tyranja merged commit 3030fd6 into main Jul 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants