I've resorted to manually creating UserRole instances whilst. Will check the git code out later, if I find the time :) thx for the tip.
2009/10/28 Brian Smith <wbsmit...@gmail.com> > Also make sure that you don't have any validations or hooks that are > preventing the association from saving. > > > On Tue, Oct 27, 2009 at 8:55 PM, MarkMT <mark.thom...@ieee.org> wrote: > >> >> I've actually had a problem that looks suspiciously similar in the >> last couple of days. It turned out that a patch Dan made yesterday >> fixed it - >> >> >> http://github.com/datamapper/dm-core/commit/9115894c50af7f7119cff75df001510b79fce951 >> >> I suggest grabbing the latest from github and see if that fixes the >> problem. >> >> >> >> Chris wrote: >> > Anyone encountered this before? >> > >> > >> @officer_role = Role.first(:label => :Officer) >> > => #<Role @id=3 @label="Officer" @description=<not loaded>> >> > >> agustina.roles << @officer_role >> > => [#<Role @id=1 @label="Admin" @description=nil>, #<Role @id=3 >> > @label="Officer" @description=<not loaded>>] >> > >> agustina.save >> > => true >> > >> agustina.reload >> > => #<User @id=1 @login="xxx" @active=true @crypted_password="xxx" >> > @salt="xxx"> >> > >> agustina.roles >> > => [#<Role @id=1 @label="Admin" @description=nil>] >> > >> > It adds the object to the array, but as soon as I save, it disappears... >> It >> > also refuses to see the instance as dirty, no matter how much I change >> the >> > roles array. >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to datamapper@googlegroups.com To unsubscribe from this group, send email to datamapper+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---