diff options
author | Josh Kalderimis <josh.kalderimis@gmail.com> | 2010-05-11 12:28:42 +0200 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-05-13 13:57:37 -0700 |
commit | 9131a88bb8e82f139ec49b4057fb6065ba0a2c6a (patch) | |
tree | 5586a5c35711866acdbc2408cc70e50197229fae /activemodel/lib/active_model/validations.rb | |
parent | 2203c781a7dfa8b0c8b6c97cd318d941f9fbb26c (diff) | |
download | rails-9131a88bb8e82f139ec49b4057fb6065ba0a2c6a.tar.gz rails-9131a88bb8e82f139ec49b4057fb6065ba0a2c6a.tar.bz2 rails-9131a88bb8e82f139ec49b4057fb6065ba0a2c6a.zip |
validation macros can now be used within an instance
Diffstat (limited to 'activemodel/lib/active_model/validations.rb')
-rw-r--r-- | activemodel/lib/active_model/validations.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb index 7c705b8899..1e2901633e 100644 --- a/activemodel/lib/active_model/validations.rb +++ b/activemodel/lib/active_model/validations.rb @@ -46,6 +46,9 @@ module ActiveModel included do extend ActiveModel::Translation + + extend HelperMethods; include HelperMethods + define_callbacks :validate, :scope => :name attr_accessor :validation_context @@ -138,12 +141,6 @@ module ActiveModel def attribute_method?(attribute) method_defined?(attribute) end - private - - def _merge_attributes(attr_names) - options = attr_names.extract_options! - options.merge(:attributes => attr_names.flatten) - end end # Returns the Errors object that holds all information about attribute error messages. |