fix small error in user model
need to use the parent's generation to calculate generation!
This commit is contained in:
parent
3b89a2a13f
commit
b037c84f15
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ class User < ActiveRecord::Base
|
|||
if code == joinedwithcode
|
||||
update(generation: 0)
|
||||
else
|
||||
update(generation: User.find_by_code(joinedwithcode) + 1)
|
||||
update(generation: User.find_by_code(joinedwithcode).generation + 1)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue