jviney / acts_as_taggable_on_steroids

Tagging for Ruby on Rails
MIT License
241 stars 63 forks source link

deprecated: destroy_after #8

Open MikieC opened 14 years ago

MikieC commented 14 years ago
DEPRECATION WARNING: Base#after_destroy has been deprecated, please use Base.after_destroy :method instead. (called from  at /home/user/rails_app/vendor/plugins/acts_as_taggable_on_steroids/lib/tagging.rb:5)

I'm not sure the right change for this. I'm giving this a try for now, which doesn't give a warning:

  ---- tagging_old.rb   2010-09-06 17:48:31.460083461 -0700
  ++++ tagging.rb   2010-09-06 17:47:52.440549426 -0700
  @@ -2,7 +2,7 @@
     belongs_to :tag
     belongs_to :taggable, :polymorphic => true

  -  def after_destroy 
  +  after_destroy do |tag|
       if Tag.destroy_unused
         if tag.taggings.count.zero?
           tag.destroy

I referenced this page for the correct method:

http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html

pdeffendol commented 14 years ago

I've also made a fix for this - see fragility/acts_as_taggable_on_steroids@db15aa92df37f53bf3c765be5dcd6d887e750084