# Table name: users
#
# email :string not null
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# pass_crypt :string not null
# creation_time :datetime not null
# display_name :string default(""), not null
# diary_entries_count :integer default(0), not null
# image_use_gravatar :boolean default(FALSE), not null
# auth_provider :string
-# home_tile :bigint(8)
+# home_tile :bigint
# tou_agreed :datetime
# diary_comments_count :integer default(0)
# note_comments_count :integer default(0)
trace_score = traces.size * 50
diary_entry_score = diary_entries.visible.inject(0) { |acc, elem| acc + elem.body.spam_score }
diary_comment_score = diary_comments.visible.inject(0) { |acc, elem| acc + elem.body.spam_score }
- report_score = Report.where(:category => "spam", :issue => issues.with_status("open")).count * 20
+ report_score = Report.where(:category => "spam", :issue => issues.with_status("open")).distinct.count(:user_id) * 20
score = description.spam_score / 4.0
score += diary_entries.visible.where("created_at > ?", 1.day.ago).count * 10