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) }
##
# perform a spam check on a user
def spam_check
- if status == "active" && spam_score > SPAM_THRESHOLD
- update(:status => "suspended")
- end
+ update(:status => "suspended") if status == "active" && spam_score > SPAM_THRESHOLD
end
##