Skip to content
Browse files

add #destroy support

git-svn-id: http://svn.techno-weenie.net/projects/plugins/active_record_context@3040 567b1171-46fb-0310-a4c9-b4bef9110e78
  • Loading branch information...
1 parent 5330738 commit 65ba031b72c445e6e382faa93277fbf5bc71132b technoweenie committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/technoweenie/active_record_context.rb
View
6 lib/technoweenie/active_record_context.rb
@@ -3,6 +3,7 @@ module ActiveRecordContext
def self.included(base)
base.extend ClassMethods
base.alias_method_chain :reload, :context
+ base.alias_method_chain :destroy_without_callbacks, :context
base.cattr_accessor :context_cache
end
@@ -73,5 +74,10 @@ def reload_with_context(options = nil)
self.class.cached[id.to_i] = nil
reload_without_context(options)
end
+
+ def destroy_without_callbacks_with_context
+ self.class.cached[id.to_i] = nil
+ destroy_without_callbacks_without_context
+ end
end
end

0 comments on commit 65ba031

Please sign in to comment.
Something went wrong with that request. Please try again.