X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/81241b30835fe090ebc9f511d1954a5c511c94ca..13e7a4b0e94749e65cb6b7703e86daf5e312064e:/app/models/user.rb?ds=sidebyside diff --git a/app/models/user.rb b/app/models/user.rb index 1cd8c6d89..2d51b5af5 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) }