Module Searchlogic::NamedScopes::ColumnConditions
In: lib/searchlogic/named_scopes/column_conditions.rb

Handles dynamically creating named scopes for columns. It allows you to do things like:

  User.first_name_like("ben")
  User.id_lt(10)

Notice the constants in this class, they define which conditions Searchlogic provides.

See the README for a more detailed explanation.

Methods

Constants

COMPARISON_CONDITIONS = { :equals => [:is, :eq], :does_not_equal => [:not_equal_to, :is_not, :not, :ne], :less_than => [:lt, :before], :less_than_or_equal_to => [:lte], :greater_than => [:gt, :after], :greater_than_or_equal_to => [:gte], }
WILDCARD_CONDITIONS = { :like => [:contains, :includes], :not_like => [:does_not_include], :begins_with => [:bw], :not_begin_with => [:does_not_begin_with], :ends_with => [:ew], :not_end_with => [:does_not_end_with]
BOOLEAN_CONDITIONS = { :null => [:nil], :not_null => [:not_nil], :empty => [], :blank => [], :not_blank => [:present]
CONDITIONS = {}
PRIMARY_CONDITIONS = CONDITIONS.keys
ALIAS_CONDITIONS = CONDITIONS.values.flatten

Public Instance methods

Is the name of the method a valid condition that can be dynamically created?

We want to return true for any conditions that can be called, and while we‘re at it. We might as well create the condition so we don‘t have to do it again.

[Validate]