Skip to content

Commit

Permalink
Add: Destroy preferences when destroying parent object
Browse files Browse the repository at this point in the history
  • Loading branch information
milann authored and rds committed Aug 24, 2011
1 parent ca1a77b commit 31c1a9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/preferences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def preference(name, *args)
class_inheritable_hash :preference_definitions
self.preference_definitions = {}

has_many :stored_preferences, :as => :owner, :class_name => 'Preference'
has_many :stored_preferences, :as => :owner, :class_name => 'Preference', :dependent => :destroy

after_save :update_preferences

Expand Down

0 comments on commit 31c1a9b

Please sign in to comment.