This project is archived and is in readonly mode.
using 'find_or_create_by' with multiple attributes through an association
Reported by Jon Buda | July 28th, 2010 @ 02:16 AM | in 3.0.2
While using find_or_create_by
with multiple
attributes through a has many assocation, attributes were being
joined by 'and' and not 'and' causing it to fail if the
record didn't exist.
ie.
author.posts.find_or_create_by_title_and_body('the title', 'the body')
would try to call find_or_create_by_titlebody
Comments and changes to this ticket
-
Santiago Pastorino July 28th, 2010 @ 04:49 AM
- Assigned user set to Santiago Pastorino
- State changed from new to committed
- Milestone cleared.
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>