Created
December 1, 2008 04:21
-
-
Save matthooks/30618 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
if options[:validate_password_field] | |
validates_length_of options[:password_field], {:minimum => 4, :if => "validate_#{options[:password_field]}?".to_sym}.merge(options[:password_field_validates_length_of_options]) | |
validates_confirmation_of options[:password_field], options[:password_field_validates_confirmation_of_options].merge(:if => "#{options[:password_salt_field]}_changed?".to_sym) | |
validates_presence_of "#{options[:password_field]}_confirmation", :if => "#{options[:password_salt_field]}_changed?".to_sym | |
end | |
### | |
class_eval <<-"end eval", __FILE__, __LINE__ | |
# etc | |
def validate_#{options[:password_field]}? | |
self.#{options[:crypted_password_field]}.blank? | |
end | |
# etc | |
end_eval |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment