#907 ✓resolved
Martin Gamsjaeger (snusnu)

dm-validations should hook before :save_self

Reported by Martin Gamsjaeger (snusnu) | June 15th, 2009 @ 09:16 PM | in 0.10.0

Ticket added in reference to a discussion with dkubb on irc.

Say i have Person.has(1, :profile) and i want to: "p = Person.new; p.profile_attributes = { :nick => 'snusnu' }; p.save", then dm-validations currently tries to validate the profile before it passes on to super#save. The problem with this is, that at this time, the parent person hasn't been created (because #save_parents hasn't yet kicked in), and it complains about fk being nil

dbussink mentioned that it might be possible to let dm-validations only check if a relationship has been set, and not if it has an fk value.

It might be enough to just hook before :save_self though. It should help in the case described above.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Pages