X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/dae3dcf87edcfc0648cd0b93b069b0eee67d3ab7..69c1f6d1862aad00f80a0d2e32dbbe70aba65649:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index a550b9f05..1c38ea1cc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -26,6 +26,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) }