X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fc90b7358124ce9017a94b3f6e4a779fbc28c71c..7dbf8d83369cb73929080c4ba23fdd7dcd0184df:/app/models/user.rb?ds=sidebyside diff --git a/app/models/user.rb b/app/models/user.rb index da3964142..2a0a5ab45 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -75,6 +75,11 @@ class User < ActiveRecord::Base has_many :roles, :class_name => "UserRole" + has_many :issues, :class_name => "Issue", :foreign_key => :reported_user_id + has_many :issue_comments + + has_many :reports + scope :visible, -> { where(:status => %w[pending active confirmed]) } scope :active, -> { where(:status => %w[active confirmed]) } scope :identifiable, -> { where(:data_public => true) }