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

Feature/cclow sector filter #279

Merged
merged 3 commits into from
Feb 21, 2020
Merged

Feature/cclow sector filter #279

merged 3 commits into from
Feb 21, 2020

Conversation

batraisk
Copy link

No description provided.

def filter_by_sector
return scope unless params[:law_sector].present?

scope.includes(:laws_sectors).where(laws_sectors: {id: params[:law_sector]})
Copy link
Contributor

Choose a reason for hiding this comment

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

we can just use joins here, if we don't need to include the laws_sectors objects in Ruby.

def filter_by_sector
return scope unless params[:law_sector].present?

scope.includes(:laws_sectors).where(laws_sectors: {id: params[:law_sector]})
Copy link
Contributor

Choose a reason for hiding this comment

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

same as below

Copy link
Contributor

@simaob simaob left a comment

Choose a reason for hiding this comment

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

Thanks for this. I made the small replacement of includes with joins and am merging now

@simaob simaob merged commit afcf1cf into develop Feb 21, 2020
@simaob simaob deleted the feature/cclow-sector-filter branch February 21, 2020 14:46
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.

None yet

2 participants