X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/107e9515b35544cb8e4ac66838b9a37f95cdfa89..dbd88d893f3c3fce9cafd666b94396988646d81f:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 3ce48e7cd..63c9527c7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -28,6 +28,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) }