diff options
author | Maxwell Salzberg <maxwell@joindiaspora.com> | 2012-04-04 10:54:20 +0400 |
---|---|---|
committer | Maxwell Salzberg <maxwell@joindiaspora.com> | 2012-05-15 08:53:16 +0400 |
commit | ab2e740ca2e716bc0f48e6be1f82b3da9b8398dd (patch) | |
tree | 75a01147433839be87825fa99efd5e58f45a47d3 /app/models/notification.rb | |
parent | 4d58940e519036a3ce4471128396ece768bdea53 (diff) |
upgrade to Rails 3.2.3
Diffstat (limited to 'app/models/notification.rb')
-rw-r--r-- | app/models/notification.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/notification.rb b/app/models/notification.rb index d01313b8d..a60d8cdb9 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -8,6 +8,8 @@ class Notification < ActiveRecord::Base has_many :actors, :class_name => 'Person', :through => :notification_actors, :source => :person belongs_to :target, :polymorphic => true + attr_accessor :note_html + def self.for(recipient, opts={}) self.where(opts.merge!(:recipient_id => recipient.id)).order('updated_at desc') end @@ -33,6 +35,10 @@ class Notification < ActiveRecord::Base end end + def as_json(opts={}) + super(opts.merge(:methods => :note_html)) + end + def email_the_user(target, actor) self.recipient.mail(self.mail_job, self.recipient_id, actor.id, target.id) end |