Hi Steve, Unfortunately it's not that easy to override the association (because it's a macro, and Desert doesn't handle mixing those in).
> I created app/models/user.rb to override specific things from the core > CE user.rb model. Here is my simple app/models/user.rb: > > class User < ActiveRecord::Base > > has_many :comments_as_author, :class_name => "Comment", :foreign_key > => "user_id", :order => "created_at desc", :dependent => :nullify > > end > Exactly. This is what you'd expect. But since the 'has_many' is not a class or instance method, but a macro, Desert doesn't override it. I'm not exactly sure how to get around this; I think you might have to dig into the ActiveRecord callback chain and override where the associated comments are destroyed. Anybody have other ideas? Thanks, Bruno The only difference between the two is the :dependent action. As you > can see, I'm trying to override ":destroy" with ":nullify". But this > doesn't work: When I delete a user, all the user's comments are > deleted as well. > > Please, any help is appreciated. Thanks, > Steve > > > -- > You received this message because you are subscribed to the Google Groups > "CommunityEngine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<communityengine%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/communityengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "CommunityEngine" 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/communityengine?hl=en.
