Skip to content

Commit

Permalink
Added any! and all! methods to the ActiveRecord model object
Browse files Browse the repository at this point in the history
  • Loading branch information
zachinglis committed Nov 7, 2008
1 parent f9bdd85 commit 38c8b13
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/searchlogic/conditions/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,20 @@ def any?
["true", "1", "yes"].include? @any.to_s
end

# Sets the conditions to be searched by "or"
def any!
any = true
end

def all # :nodoc:
not any?
end

# Sets the conditions to be searched by "and"
def all!
any = false
end

# A list of joins to use when searching, includes relationships
def auto_joins
j = []
Expand Down

0 comments on commit 38c8b13

Please sign in to comment.