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

Refactor find_by for translated attributes #160

Merged
merged 1 commit into from
Jan 29, 2018

Conversation

shioyama
Copy link
Owner

@shioyama shioyama commented Jan 29, 2018

In #159, I changed how the jsonb and container backends query on translated attributes, but I noticed that this wasn't applying to some first_by_<x>-type queries in Sequel. The reason is that some code had not been updated to the new format, but I realized it's much easier to just refactor all this first_by_<x> (Sequel) + find_by_<x> (AR) method code to define these methods once, basically as an alias independent of the backend query details.

This improves consistency and also chops off about 50 lines of code 😄

@shioyama shioyama force-pushed the refactor_query_method_find_by branch from 7fe5a2d to 3b3e822 Compare January 29, 2018 12:20
@shioyama shioyama merged commit 3b3e822 into master Jan 29, 2018
@shioyama shioyama deleted the refactor_query_method_find_by branch February 14, 2018 13:15
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.

1 participant