]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/diary_entry.rb
fix rubocop warnings
[rails.git] / app / models / diary_entry.rb
index 368ee3aca802dc1770b7a5b87d25d38706205dea..e756432fdf4a3b285ec410dfddceb06f50d78442 100644 (file)
@@ -4,6 +4,8 @@ class DiaryEntry < ActiveRecord::Base
 
   has_many :comments, -> { order(:id).preload(:user) }, :class_name => "DiaryComment"
   has_many :visible_comments, -> { joins(:user).where(:visible => true, :users => { :status => %w(active confirmed) }).order(:id) }, :class_name => "DiaryComment"
+  has_many :subscriptions, :class_name => "DiaryEntrySubscription"
+  has_many :subscribers, :through => :subscriptions, :source => :user
 
   scope :visible, -> { where(:visible => true) }