Sha256: b9febaa2063e00265c7ae8390da16a13aa0921287562d11e54f95d5a5cc32494
Contents?: true
Size: 584 Bytes
Versions: 3
Compression:
Stored size: 584 Bytes
Contents
class Article < ActiveRecord::Base belongs_to :user has_many :comments, dependent: :destroy has_many :commented_users, through: :comments, source: :user validates :user, presence: true acts_as_notifiable :users, targets: ->(article) { User.all.to_a - [article.user] }, notifier: :user, email_allowed: true, printable_name: ->(article) { "new article \"#{article.title}\"" }, dependent_notifications: :delete_all acts_as_notification_group printable_name: ->(article) { "article \"#{article.title}\"" } def author?(user) self.user == user end end
Version data entries
3 entries across 3 versions & 1 rubygems