Sha256: 3d1baa96dded40731ea43a521a692b576632ef96e590269384cdaf95a3cd4ee7
Contents?: true
Size: 691 Bytes
Versions: 4
Compression:
Stored size: 691 Bytes
Contents
class Comment < ActiveRecord::Base belongs_to :article belongs_to :user validates :article, presence: true validates :user, presence: true acts_as_notifiable :users, targets: ->(comment, key) { ([comment.article.user] + comment.article.commented_users.to_a - [comment.user]).uniq }, group: :article, notifier: :user, email_allowed: true, parameters: { test_default_param: '1' }, notifiable_path: :article_notifiable_path, printable_name: ->(comment) { "comment \"#{comment.body}\"" }, dependent_notifications: :delete_all def article_notifiable_path article_path(article) end def author?(user) self.user == user end end
Version data entries
4 entries across 4 versions & 1 rubygems