X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c819c8114d6e88f7e3a7ec4da93b4060e7aff3bc..5e7abf67fbda21735d12660a537a96e39bb87107:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 1cd8c6d89..c063b7c34 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -73,6 +73,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) }