X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/cb87f02642d0097ebc067ca1f9371dde274a41e3..8dc8479e12b50878ca6b476a4dd72fe1da1f24ad:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 7a8414ec0..678bbad9d 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) }