Permalink
Browse files

* Undefine the id method for the Search class, so that it acts like a…

… condition.
  • Loading branch information...
1 parent f4b2e25 commit 101d488135dbc8b58840b1c4ffcc82b688d6b3c1 @binarylogic committed Jul 3, 2009
Showing with 10 additions and 0 deletions.
  1. +4 −0 CHANGELOG.rdoc
  2. +1 −0 lib/searchlogic/search.rb
  3. +5 −0 spec/search_spec.rb
View
@@ -1,3 +1,7 @@
+== 2.1.2
+
+* Undefine the id method for the Search class, so that it acts like a condition.
+
== 2.1.1 released 2009-06-28
* Added inner_join convenience method.
@@ -36,6 +36,7 @@ def initialize(condition)
end
attr_accessor :klass, :current_scope, :conditions
+ undef :id
# Creates a new search object for the given class. Ex:
#
View
@@ -136,6 +136,11 @@
lambda { search.unknown = true }.should raise_error(Searchlogic::Search::UnknownConditionError)
end
+ it "should not use the ruby implementation of the id method" do
+ search = User.search
+ search.id.should be_nil
+ end
+
context "type casting" do
it "should be a Boolean given true" do
search = User.search

0 comments on commit 101d488

Please sign in to comment.