Skip to content
Browse files

don't override `delete_all` to use an exclusive scope

Model.some_named_scope.another_scope.delete_all would ignore the scope,
deleting all records in the table. NOT what we want
  • Loading branch information...
1 parent a9f2fdd commit 34262ef00bfc2044cfe58378203c6119b3ade0f4 @mislav committed
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/is_paranoid.rb
View
11 lib/is_paranoid.rb
@@ -25,11 +25,12 @@ def is_paranoid
# this method is called internally by Model.delete(id) and on the
# delete method in each instance, we don't need to specify those
# methods separately
- def self.delete_all conditions = nil
- self.with_exclusive_scope do
- super conditions
- end
- end
+ ## FIXME: this is dangerous. find a better solution
+ # def self.delete_all conditions = nil
+ # self.with_exclusive_scope do
+ # super conditions
+ # end
+ # end
# Return a count that includes the soft-deleted models.
def self.count_with_destroyed *args

0 comments on commit 34262ef

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