Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ #find_by_id is the new default for populate_with
- Loading branch information
Showing
2 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2052f1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_by_id
inActiveRecord
returns only one object, not objects collection. Its a bug or feature? :)2052f1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the note. If you pass an Array as the first parameter,
find_by_id
behaves likefind_all_by_id
. Perhaps I should explicitly usefind_all_by_id
. Please correct me if I am wrong!Update: This was wrong ;)
2052f1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you pass an Array as the first parameter
find_by_id
return object with id equal to the first element of the array.2052f1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which version are you talking about? My integration tests disagree with you.
Edit: No, my integration tests just don't test this ;) I'll look into it.
2052f1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I talking about
activerecord
3.2.8. Could you provide a link to this test?2052f1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Michał, you've found a bug :) A fix using
find_all_by_id
is released in 4.12.1. (Also see https://github.com/floere/picky/wiki/Contributions-and-contributors)2052f1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
2052f1a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a project you'd like presented, just add it to the contributors page :)