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: '%?', doesnt_contain: 'not_%?%', doesnt_begin_with: 'not_?%', doesnt_end_with: 'not_%?' }.freeze
- NULL_COMPARATORS =
%w[null not_null].freeze
- DATE_COMPARATORS =
%w[PAST FUTURE RANGE].freeze
- DATE_UNITS =
%w[DAYS WEEKS MONTHS YEARS].freeze
- TIME_UNITS =
%w[SECONDS MINUTES HOURS].freeze
- DATE_RANGES =
%w[TODAY YESTERDAY TOMORROW THIS_WEEK PREV_WEEK NEXT_WEEK THIS_MONTH PREV_MONTH NEXT_MONTH THIS_YEAR PREV_YEAR NEXT_YEAR].freeze
Class Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
539 540 541 |
# File 'lib/active_scaffold/finder.rb', line 539 def self.included(klass) klass.extend ClassMethods end |
.like_operator ⇒ Object
5 6 7 |
# File 'lib/active_scaffold/finder.rb', line 5 def self.like_operator @@like_operator ||= ::ActiveRecord::Base.connection.adapter_name.in?(%w[PostgreSQL PostGIS]) ? 'ILIKE' : 'LIKE' end |
.logical_comparators ⇒ Object
9 10 11 |
# File 'lib/active_scaffold/finder.rb', line 9 def self.logical_comparators ActiveScaffold::Finder::LOGICAL_COMPARATORS if ActiveScaffold::Finder.const_defined? :LOGICAL_COMPARATORS end |