diff options
Diffstat (limited to 'app/models/comment.rb')
-rw-r--r-- | app/models/comment.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/comment.rb b/app/models/comment.rb index e29b574c1..3b2044123 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -20,12 +20,20 @@ class Comment < ActiveRecord::Base belongs_to :commented, :polymorphic => true, :counter_cache => true belongs_to :author, :class_name => 'User' - validates_presence_of :commented, :author, :comments + validates_presence_of :commented, :author, :content after_create :send_notification safe_attributes 'comments' + def comments=(arg) + self.content = arg + end + + def comments + content + end + private def send_notification |