Sha256: 5b74fc7fb02bee64f370fda52e564f74cbf581d33e4b7772058600649d1c26da

Contents?: true

Size: 341 Bytes

Versions: 1

Compression:

Stored size: 341 Bytes

Contents

class Article < ActiveRecord::Base
  belongs_to :user
  has_many :comments, dependent: :delete_all
  has_many :commented_users, through: :comments, source: :user
  validates :user, presence: true

  acts_as_notifiable :users,
    targets: ->(article, key) { User.all.to_a - [article.user] },
    notifier: :user,
    email_allowed: true
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activity_notification-0.0.10 spec/rails_app/app/models/article.rb