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

The order method breaks finders #193

Open
bibendi opened this issue Jan 21, 2020 · 2 comments
Open

The order method breaks finders #193

bibendi opened this issue Jan 21, 2020 · 2 comments

Comments

@bibendi
Copy link

bibendi commented Jan 21, 2020

Hi @zilkey

After updating to v3.1 to use the new order method, I've experienced problems with finders.

> Language.find(54)
=> #<Language:0x00005583fd959238 @attributes={:id=>54, :code=>"en", :title=>"English"}>

> Language.order(title: :asc)

> Language.find(54)
=> #<Language:0x00005583fd9c7a58 @attributes={:id=>192, :code=>"gd", :title=>"Gàidhlig"}>

I think there is a mutation of original records causing the breaking of record_index.

@flavorjones
Copy link
Collaborator

@kbrock I think I like the fix in #261 for this (which is simpler than what's introduced in #197). WDYT about merging it?

@kbrock
Copy link
Collaborator

kbrock commented Mar 27, 2023

Thank you for raising this issue. It is fixed by #268

beeLorna added a commit to beeLorna/plant-helper that referenced this issue Apr 24, 2023
active_hash had an issue raised which seems to relate to the bug in
production where .order method breaks finder, returning the wrong record
for the given parameters

active-hash/active_hash#193
beeLorna added a commit to beeLorna/plant-helper that referenced this issue May 14, 2023
active_hash had an issue raised which seems to relate to the bug in
production where .order method breaks finder, returning the wrong record
for the given parameters

active-hash/active_hash#193
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 a pull request may close this issue.

3 participants