diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-10-12 22:15:43 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-10-12 22:15:43 -0500 |
commit | 21e7b8462113fc7c0fd1882dcc2bf7225de67b1a (patch) | |
tree | 81350780f50b8378aec99210d956bba3dda635f7 /activemodel/lib/active_model | |
parent | 9bc8defe38253840ceb9c4ad92e7c3abc0066ed8 (diff) | |
download | rails-21e7b8462113fc7c0fd1882dcc2bf7225de67b1a.tar.gz rails-21e7b8462113fc7c0fd1882dcc2bf7225de67b1a.tar.bz2 rails-21e7b8462113fc7c0fd1882dcc2bf7225de67b1a.zip |
Callbacks, DeprecatedCallbacks = NewCallbacks, Callbacks
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/validations.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb index edeb508a08..0f178a07c8 100644 --- a/activemodel/lib/active_model/validations.rb +++ b/activemodel/lib/active_model/validations.rb @@ -1,12 +1,10 @@ require 'active_support/core_ext/array/extract_options' require 'active_support/core_ext/hash/keys' -require 'active_support/concern' -require 'active_support/callbacks' module ActiveModel module Validations extend ActiveSupport::Concern - include ActiveSupport::NewCallbacks + include ActiveSupport::Callbacks included do define_callbacks :validate, :scope => :name @@ -99,7 +97,7 @@ module ActiveModel def invalid? !valid? end - + protected # Hook method defining how an attribute value should be retieved. By default this is assumed # to be an instance named after the attribute. Override this method in subclasses should you @@ -110,9 +108,9 @@ module ActiveModel # def initialize(data = {}) # @data = data # end - # + # # private - # + # # def read_attribute_for_validation(key) # @data[key] # end |