Module: ActiveScaffold::Finder

Defined in:
lib/active_scaffold/finder.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

NumericComparators =
[
  '=',
  '>=',
  '<=',
  '>',
  '<',
  '!=',
  'BETWEEN'
]
StringComparators =
{
  :contains    => '%?%',
  :begins_with => '?%',
  :ends_with   => '%?'
}
NullComparators =
[
  :null,
  :not_null
]

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



206
207
208
# File 'lib/active_scaffold/finder.rb', line 206

def self.included(klass)
  klass.extend ClassMethods
end

.like_operatorObject



3
4
5
# File 'lib/active_scaffold/finder.rb', line 3

def self.like_operator
  @@like_operator ||= ::ActiveRecord::Base.connection.adapter_name == "PostgreSQL" ? "ILIKE" : "LIKE"
end