mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
New user_stats table to keep track of queried information on a user.
This is information that is not usually needed when representing a user and is in a separate table with a has one relationship to avoid querying it all the time.
This commit is contained in:
12
spec/models/user_stat_spec.rb
Normal file
12
spec/models/user_stat_spec.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe UserStat do
|
||||
|
||||
it { should belong_to :user }
|
||||
|
||||
it "is created automatically when a user is created" do
|
||||
user = Fabricate(:evil_trout)
|
||||
user.user_stat.should be_present
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user