From 0c9f041f28b57d1f0259521a294f0c65f4dd24ec Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 18 Aug 2010 21:42:37 -0700 Subject: [PATCH] we need do bad things in the user for seeding the database --- app/models/user.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 56f7882d1..b9b03dede 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -16,6 +16,7 @@ class User many :groups, :class_name => 'Group' + before_validation :do_bad_things after_validation_on_create :setup_person ######## Making things work ######## @@ -302,7 +303,11 @@ class User terse = terse.chop! if terse[-1, 1] == '/' terse end - + + def do_bad_things + self.password_confirmation = self.password + end + def visible_person_by_id( id ) id = ensure_bson id return self.person if id == self.person.id