Displaying 1 result from an estimated 1 matches for "people_song".
Did you mean:
people_songs
2011 Feb 24
1
Rails 3 save parent model and association if nested attributes validation fails for uniqueness
Hi,
Song
has_and_belongs_to_many :people
accepts_nested_attributes_for :people
Person
validates :uniqueness => true
If person record not present, nested attributes working great! in rails way.
i.e., inserting into songs, people and people_songs table correctly.
I am interested in:-
*If there is person exist, it should skip insertion into people table but
data should be inserted in songs and people_songs table (association
table). *
*
*
There are lots of approach to solve this problem. I usually comes with some
ugly way to deal with this...