I'd like to override the setter for an association, but
write_attribute() isn't working - probably because that method only
works for database columns.

I have tried super(), but that doesn't work either (didn't think it
would... but it was worth a guess).

How do I override the setter? Here is what I am trying to do:

      def parent=(value)
        # this line needs to be changed
        write_attribute(:parent, value)

        if value.subject.start_with?('Re:')
          self.subject = "#{value.subject}"
        else
          self.subject = "Re: #{value.subject}"
        end

        self.receivers << value.sender
      end

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to