aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-12-30 13:48:20 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2009-12-30 13:48:20 -0800
commit17787fbfdbb1aa8fa8838e447e9acc7068eab130 (patch)
tree5cdb0262dcea0e52b800434179e6307878c8399a /activerecord
parentbb153f42e45160c5ef3593c393db5d3c6857fb70 (diff)
parent97a64b6b22d87cb6f89a224f7832433b86b545c0 (diff)
downloadrails-17787fbfdbb1aa8fa8838e447e9acc7068eab130.tar.gz
rails-17787fbfdbb1aa8fa8838e447e9acc7068eab130.tar.bz2
rails-17787fbfdbb1aa8fa8838e447e9acc7068eab130.zip
Merge commit 'josevalim/callbacks'
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/association_collection.rb9
-rw-r--r--activerecord/lib/active_record/callbacks.rb2
-rw-r--r--activerecord/lib/active_record/validations.rb2
3 files changed, 9 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb
index b2b3a9789c..1ceb0dbf96 100644
--- a/activerecord/lib/active_record/associations/association_collection.rb
+++ b/activerecord/lib/active_record/associations/association_collection.rb
@@ -485,7 +485,14 @@ module ActiveRecord
def callback(method, record)
callbacks_for(method).each do |callback|
- ActiveSupport::DeprecatedCallbacks::Callback.new(method, callback, record).call(@owner, record)
+ case callback
+ when Symbol
+ @owner.send(callback, record)
+ when Proc
+ callback.call(@owner, record)
+ else
+ callback.send(method, @owner, record)
+ end
end
end
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb
index e1d772bd95..e2a8f03c8f 100644
--- a/activerecord/lib/active_record/callbacks.rb
+++ b/activerecord/lib/active_record/callbacks.rb
@@ -274,7 +274,7 @@ module ActiveRecord
def deprecated_callback_method(symbol) #:nodoc:
if respond_to?(symbol)
- ActiveSupport::Deprecation.warn("Base##{symbol} has been deprecated, please use Base.#{symbol} :method instead")
+ ActiveSupport::Deprecation.warn("Overwriting #{symbol} in your models has been deprecated, please use Base##{symbol} :method_name instead")
send(symbol)
end
end
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index e8a2a72735..12c1f23763 100644
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -17,8 +17,6 @@ module ActiveRecord
module Validations
extend ActiveSupport::Concern
-
- include ActiveSupport::DeprecatedCallbacks
include ActiveModel::Validations
included do