diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-19 18:18:45 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-19 18:20:02 +0200 |
commit | 0247995d05b3cd3ff5fe32d5fbd8fdd866646909 (patch) | |
tree | 83cf6bf49a9f6421100ac765f025c508b6995ad1 /activerecord/lib | |
parent | 51739d3228d12907d60fb1b0a2b1ef96c55f66a3 (diff) | |
download | rails-0247995d05b3cd3ff5fe32d5fbd8fdd866646909.tar.gz rails-0247995d05b3cd3ff5fe32d5fbd8fdd866646909.tar.bz2 rails-0247995d05b3cd3ff5fe32d5fbd8fdd866646909.zip |
ActiveModel::Validations::Callbacks should not be required by default.
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 1 | ||||
-rw-r--r-- | activerecord/lib/active_record/callbacks.rb | 10 |
2 files changed, 2 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index ef8dbdb6e5..def0fdaa2f 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1874,7 +1874,6 @@ module ActiveRecord #:nodoc: extend ActiveSupport::DescendantsTracker include ActiveModel::Conversion - include ActiveModel::Validations::Callbacks include Validations extend CounterCache include Locking::Optimistic, Locking::Pessimistic diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index 42b56a3cf8..997c85ef8c 100644 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -234,8 +234,7 @@ module ActiveRecord included do extend ActiveModel::Callbacks - - attr_accessor :validation_context + include ActiveModel::Validations::Callbacks define_model_callbacks :initialize, :find, :only => :after define_model_callbacks :save, :create, :update, :destroy @@ -249,12 +248,6 @@ module ActiveRecord send(meth.to_sym, meth.to_sym) end end - - end - - def valid?(*) #:nodoc: - self.validation_context = new_record? ? :create : :update - super end def destroy #:nodoc: @@ -269,6 +262,7 @@ module ActiveRecord end private + def create_or_update #:nodoc: _run_save_callbacks { super } end |