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

Simplify ArticlesController#feed #1932

Merged
merged 2 commits into from Mar 1, 2019
Merged

Simplify ArticlesController#feed #1932

merged 2 commits into from Mar 1, 2019

Conversation

rhymes
Copy link
Contributor

@rhymes rhymes commented Feb 28, 2019

There's unneeded complexity in the logic of the feed method, this way what separates each path should be clearer.

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

  • Refactor
  • Feature
  • Bug Fix
  • Documentation Update

Description

I came across ArticlesController#feed and noticed that the ORM logic was a bit convoluted and repeated in each if/else clause. Since AR is a lazy and composable ORM, I decided to simplify the logic.

Added to documentation?

  • docs.dev.to
  • readme
  • no documentation needed

There's unneeded complexity in the logic of the feed method, this way what separates each path should be clearer
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Feb 28, 2019
Co-Authored-By: rhymes <rhymesete@gmail.com>
@rhymes
Copy link
Contributor Author

rhymes commented Mar 1, 2019

Thanks @maestromac!

@lightalloy
Copy link
Contributor

Nice refactoring )

@benhalpern benhalpern merged commit 996ca23 into forem:master Mar 1, 2019
@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes PR: merged bot applied label for PR's that are merged and removed PR: unreviewed bot applied label for PR's with no review labels Mar 1, 2019
@rhymes rhymes deleted the rhymes/simplify-articles-controller-feed branch March 1, 2019 15:49
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 PR: reviewed-approved bot applied label for PR's where reviewer approves changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants