we need do bad things in the user for seeding the database
This commit is contained in:
parent
7ce8f94d58
commit
0c9f041f28
1 changed files with 6 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ class User
|
||||||
|
|
||||||
many :groups, :class_name => 'Group'
|
many :groups, :class_name => 'Group'
|
||||||
|
|
||||||
|
before_validation :do_bad_things
|
||||||
after_validation_on_create :setup_person
|
after_validation_on_create :setup_person
|
||||||
|
|
||||||
######## Making things work ########
|
######## Making things work ########
|
||||||
|
|
@ -302,7 +303,11 @@ class User
|
||||||
terse = terse.chop! if terse[-1, 1] == '/'
|
terse = terse.chop! if terse[-1, 1] == '/'
|
||||||
terse
|
terse
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def do_bad_things
|
||||||
|
self.password_confirmation = self.password
|
||||||
|
end
|
||||||
|
|
||||||
def visible_person_by_id( id )
|
def visible_person_by_id( id )
|
||||||
id = ensure_bson id
|
id = ensure_bson id
|
||||||
return self.person if id == self.person.id
|
return self.person if id == self.person.id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue