1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Insert a deprecation warn notice when using AS::DeprecatedCallbacks.

We are still using DeprecatedCallbacks in AS and AR. This is meant to annoy the
shit out of Rails core until we fix it.
This commit is contained in:
Joshua Peek 2009-10-12 22:18:41 -05:00
parent 21e7b84621
commit eff61fcfa8

View file

@ -205,6 +205,8 @@ module ActiveSupport
module ClassMethods module ClassMethods
def define_callbacks(*callbacks) def define_callbacks(*callbacks)
ActiveSupport::Deprecation.warn('ActiveSupport::DeprecatedCallbacks has been deprecated in favor of ActiveSupport::Callbacks', caller)
callbacks.each do |callback| callbacks.each do |callback|
class_eval <<-"end_eval", __FILE__, __LINE__ + 1 class_eval <<-"end_eval", __FILE__, __LINE__ + 1
def self.#{callback}(*methods, &block) # def self.before_save(*methods, &block) def self.#{callback}(*methods, &block) # def self.before_save(*methods, &block)