The :dependent option expects either :destroy, :delete_all, or :nullify

For anyone else suffering this issue in their Rails app lately since the upgrade I’ve traced it to a deprecation in “acts_as_rateable” and “acts_as_taggable” which both use the value “true” for the dependent parameter instead of one of those listed.

The simple ‘hack’ to fix this is to replace “true” with “:destroy”. You’ll find the offending lines around here:


./vendor/plugins/acts_as_taggable/lib/acts_as_taggable.rb:17: has_many :taggings, :as => :taggable, :dependent => :destroy
./vendor/plugins/acts_as_rateable/lib/acts_as_rateable.rb:12: has_many :ratings, :as => :rateable, :dependent => :destroy

Blogged with Flock

Tags: , ,

Share and Enjoy:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • BlinkList
  • DZone
  • Live
  • Ma.gnolia
  • Reddit
  • Slashdot
  • SphereIt
  • StumbleUpon

Related posts:

  1. Leave the Designer to Do What He Knows Best
  2. Rails hits 1.0!!
  3. Rails Security Issues Revealed
  4. RubyCorner
  5. ‘Newbies’ First 2 Months

3 Comments to “The :dependent option expects either :destroy, :delete_all, or :nullify”

  1. Dan Garland 8 October 2008 at 8:22 pm #

    Many thanks, this helped me out. I was using rails 2.0.2. Don’t forget to restart your server after changing stuff in the vendors folder.

    Dan

  2. medieval dresses 28 April 2010 at 12:53 pm #

    Wonderful insight

  3. free magazines by mail 29 April 2010 at 11:58 pm #

    That was a awesome blog post,I just now subscribed to your feed.