Skip to content

Instantly share code, notes, and snippets.

@alkema
Created March 1, 2012 23:21
Show Gist options
  • Save alkema/1953965 to your computer and use it in GitHub Desktop.
Save alkema/1953965 to your computer and use it in GitHub Desktop.
class Comment < ActiveRecord::Base
default_scope :order => 'created_at DESC'
belongs_to :marked_entry
belongs_to :user
has_many :participants, :through => :marked_entry
def self.reply_copy
'## Reply above this line in order to comment via email ##'
end
def participants_attributes=(attributes)
attributes.each{ |a|
atts = a.last
Participant.create(atts) unless atts[:email].blank?
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment