Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

deprecated: destroy_after #8

Open
MikieC opened this issue Sep 7, 2010 · 1 comment
Open

deprecated: destroy_after #8

MikieC opened this issue Sep 7, 2010 · 1 comment

Comments

@MikieC
Copy link

MikieC commented Sep 7, 2010

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
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants