Sha256: 8d6fa9076778eddf14beea5caee125472a95fec63ce5122b86f620e74ebc1732
Contents?: true
Size: 431 Bytes
Versions: 59
Compression:
Stored size: 431 Bytes
Contents
class Discussion < ActiveRecord::Base belongs_to :forum has_many :forum_messages attr_accessor :new_message after_save :save_new_message def save_new_message self.new_message.save if self.new_message end def new_message_attributes=(attributes) unless attributes["body"].blank? self.new_message ||= ForumMessage.new(:discussion=>self) self.new_message.attributes = attributes end end end
Version data entries
59 entries across 59 versions & 1 rubygems