Permalink
Browse files

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.
  • Loading branch information...
1 parent 21e7b84 commit eff61fcfa806dc2e66712a0dcc572e5dadb939f5 @josh josh committed Oct 13, 2009
Showing with 2 additions and 0 deletions.
  1. +2 −0 activesupport/lib/active_support/deprecated_callbacks.rb
@@ -205,6 +205,8 @@ def self.included(base)
module ClassMethods
def define_callbacks(*callbacks)
+ ActiveSupport::Deprecation.warn('ActiveSupport::DeprecatedCallbacks has been deprecated in favor of ActiveSupport::Callbacks', caller)
+
callbacks.each do |callback|
class_eval <<-"end_eval", __FILE__, __LINE__ + 1
def self.#{callback}(*methods, &block) # def self.before_save(*methods, &block)

3 comments on commit eff61fc

Contributor

rubys replied Oct 13, 2009

Creating a project and attempting to generate a scaffold results in:

.../activesupport/lib/active_support/deprecation/behaviors.rb:27: private method `warn' called for nil:NilClass (NoMethodError)

More details here: http://intertwingly.net/projects/AWDwR3/checkdepot.html#section-6.2

Contributor

rubys replied Oct 13, 2009

Please sign in to comment.