search for: find_or_create_exact

Displaying 1 result from an estimated 1 matches for "find_or_create_exact".

Did you mean: find_or_create_exactly
2012 Jul 24
4
Behavior of first_or_create
...find_or_create_by_* methods, which *did* use the specified values as conditions. I''m unsure on whether this behavior is entirely undesirable, but it''s definitely not what I had expected in my use case (ensuring that a join table record exists). Perhaps there should be a variant (find_or_create_exactly, perhaps?) that uses the supplied attributes as additional conditions. If nothing else, the documentation should be updated to reflect this scenario - the last case in the examples *almost* describes this scenario, but the block form used there makes it unclear what: User.where(:first_name =&g...