validation lambda out to method
This commit is contained in:
parent
015940b60e
commit
ccbbf40584
1 changed files with 5 additions and 2 deletions
|
|
@ -21,8 +21,11 @@ class User
|
|||
|
||||
######## Making things work ########
|
||||
key :email, String
|
||||
validates_true_for :email, :logic => lambda { |email|
|
||||
email.include?('@pivotallabs.com') || email.include?('@pivotalsf.com')}
|
||||
validates_true_for :email, :logic => lambda { self.pivotal_email?}
|
||||
|
||||
def pivotal_email?
|
||||
email.include?('@pivotallabs.com')
|
||||
end
|
||||
|
||||
def method_missing(method, *args)
|
||||
self.person.send(method, *args)
|
||||
|
|
|
|||
Loading…
Reference in a new issue