Skip to content

Commit

Permalink
Insert a deprecation warn notice when using AS::DeprecatedCallbacks.
Browse files Browse the repository at this point in the history
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
josh committed Oct 13, 2009
1 parent 21e7b84 commit eff61fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions activesupport/lib/active_support/deprecated_callbacks.rb
Expand Up @@ -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)
Expand Down

3 comments on commit eff61fc

@rubys
Copy link
Contributor

@rubys rubys commented on eff61fc Oct 13, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rubys
Copy link
Contributor

@rubys rubys commented on eff61fc Oct 13, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rubys
Copy link
Contributor

@rubys rubys commented on eff61fc Oct 13, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.