Module: ActiveScaffold::Finder

Defined in:
lib/active_scaffold/finder.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

NUMERIC_COMPARATORS =
[
  '=',
  '>=',
  '<=',
  '>',
  '<',
  '!=',
  'BETWEEN'
].freeze
STRING_COMPARATORS =
{
  :contains    => '%?%',
  :begins_with => '?%',
  :ends_with   => '%?'
}.freeze
NULL_COMPARATORS =
%w[null not_null].freeze

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



368
369
370
# File 'lib/active_scaffold/finder.rb', line 368

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.in?(%w[PostgreSQL PostGIS]) ? 'ILIKE' : 'LIKE'
end