Nested Attributes and find_or_create


I’m using the new Nested Attributes to edit my models. It’s a
complicated relationship between 5 different models which are subclassed
from a ‘Metadata’ model. They all have has_and_belongs_to_many
relationships with the model I am trying to edit.

Unfortunately when I add a new nested attribute, it creates a new row in
the database. I need it to check up and determine if there is already a
nested attribute of the same name first. Is this possible?

I am exploring the find_or_create dynamic finder but I cannot figure out
how to integrate it with the nested attributes.

Thanks very much for your time

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs