X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ff962a1e1b168dc52278a1a7fe9eb21aad3f727e..424b6ef1cf760c4a3e27ac1e6f612ae42a9cd493:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 9eeb98290..352c58fb5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -73,6 +73,12 @@ class User < ActiveRecord::Base has_many :roles, :class_name => "UserRole" + has_many :issues, :class_name => "Issue", :foreign_key => :reported_user_id + has_one :issue, :class_name => "Issue", :foreign_key => :updated_by + 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) }