Permalink
Browse files

Deleting should remove mass assignments

  • Loading branch information...
1 parent 0a73ccf commit 2b6be9e665ca0ed0b5fa1f61ead6a5d6d904eeba @binarylogic committed Mar 10, 2010
Showing with 5 additions and 1 deletion.
  1. +4 −1 lib/searchlogic/search.rb
  2. +1 −0 spec/search_spec.rb
@@ -75,7 +75,10 @@ def conditions=(values)
# the scope if you do not want it anymore. A nil value might be meaningful
# to that scope.
def delete(*names)
- names.each { |name| @conditions.delete(name.to_sym) }
+ names.each do |name|
+ @conditions.delete(name.to_sym)
+ mass_conditions.delete(name)
+ end
self
end
View
@@ -54,6 +54,7 @@
search = User.search(:username_like => "bjohnson")
search.delete("username_like")
search.username_like.should be_nil
+ search.conditions["username_like"].should be_nil
end
context "conditions" do

0 comments on commit 2b6be9e

Please sign in to comment.