Howdy,
I've been trying to use the nested_attributes plugin for a particular
use-case: I want to create a nested model *and* specify its primary
key.
I noticed that there is a :strict option, but that only stops the
plugin from complaining if an instance of the nested model doesn't
already exist with the given PK. What I want it to do is create a new
instance with the given PK.
Por exemplo:
Artist.new(:name=>"YJM", :albums_attributes=>[{:id=>"foo", :name=>"RF"},
{:id=>"bar", :name=>"MO"}])
Any ideas?
Ideally here's what it should do:
* Create a new record if a record doesn't exist with the given PK.
* Update the record if a record does exist with the given PK.
* Delete the record if a record does exist with the given PK and
the :_delete flag is set.
Happy to write a patch if this behaviour sounds sensible to everyone.
Cheers
Josh
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.