2011-03-30 20:31:39 -04:00
|
|
|
module Ransack
|
|
|
|
module Constants
|
2014-10-31 14:50:39 -04:00
|
|
|
OR = 'or'.freeze
|
|
|
|
AND = 'and'.freeze
|
2014-12-01 17:45:00 -05:00
|
|
|
|
2014-11-21 12:45:05 -05:00
|
|
|
CAP_SEARCH = 'Search'.freeze
|
2014-10-31 14:50:39 -04:00
|
|
|
SEARCH = 'search'.freeze
|
2014-11-20 17:56:41 -05:00
|
|
|
SEARCHES = 'searches'.freeze
|
2014-12-01 17:45:00 -05:00
|
|
|
|
2014-10-31 14:50:39 -04:00
|
|
|
ATTRIBUTE = 'attribute'.freeze
|
2014-11-21 12:45:05 -05:00
|
|
|
ATTRIBUTES = 'attributes'.freeze
|
2014-10-31 14:50:39 -04:00
|
|
|
COMBINATOR = 'combinator'.freeze
|
2014-12-01 17:45:00 -05:00
|
|
|
|
2014-11-20 17:56:41 -05:00
|
|
|
TWO_COLONS = '::'.freeze
|
2014-10-31 14:50:39 -04:00
|
|
|
UNDERSCORE = '_'.freeze
|
2014-11-20 17:56:41 -05:00
|
|
|
LEFT_PARENTHESIS = '('.freeze
|
|
|
|
Q = 'q'.freeze
|
|
|
|
I = 'i'.freeze
|
2014-11-21 12:45:05 -05:00
|
|
|
DOT_ASTERIX = '.*'.freeze
|
2014-10-31 14:50:39 -04:00
|
|
|
|
2014-11-04 15:00:41 -05:00
|
|
|
STRING_JOIN = 'string_join'.freeze
|
|
|
|
ASSOCIATION_JOIN = 'association_join'.freeze
|
|
|
|
STASHED_JOIN = 'stashed_join'.freeze
|
|
|
|
JOIN_NODE = 'join_node'.freeze
|
|
|
|
|
2015-02-02 11:01:20 -05:00
|
|
|
TRUE_VALUES = [true, 1, '1', 't', 'T', 'true', 'TRUE'].to_set
|
|
|
|
FALSE_VALUES = [false, 0, '0', 'f', 'F', 'false', 'FALSE'].to_set
|
2014-11-21 14:03:20 -05:00
|
|
|
BOOLEAN_VALUES = (TRUE_VALUES + FALSE_VALUES).freeze
|
2011-03-30 20:31:39 -04:00
|
|
|
|
2015-08-29 16:52:57 -04:00
|
|
|
AND_OR = ['and'.freeze, 'or'.freeze].freeze
|
|
|
|
IN_NOT_IN = ['in'.freeze, 'not_in'.freeze].freeze
|
|
|
|
SUFFIXES = ['_any'.freeze, '_all'.freeze].freeze
|
|
|
|
AREL_PREDICATES = [
|
|
|
|
'eq'.freeze, 'not_eq'.freeze,
|
|
|
|
'matches'.freeze, 'does_not_match'.freeze,
|
|
|
|
'lt'.freeze, 'lteq'.freeze,
|
|
|
|
'gt'.freeze, 'gteq'.freeze,
|
|
|
|
'in'.freeze, 'not_in'.freeze
|
|
|
|
].freeze
|
|
|
|
A_S_I = ['a'.freeze, 's'.freeze, 'i'.freeze].freeze
|
2014-10-06 17:27:55 -04:00
|
|
|
|
2014-10-09 17:48:38 -04:00
|
|
|
EQ = 'eq'.freeze
|
|
|
|
NOT_EQ = 'not_eq'.freeze
|
|
|
|
EQ_ANY = 'eq_any'.freeze
|
|
|
|
NOT_EQ_ALL = 'not_eq_all'.freeze
|
2014-11-21 12:45:05 -05:00
|
|
|
CONT = 'cont'.freeze
|
2011-03-30 20:31:39 -04:00
|
|
|
|
2017-07-11 05:21:03 -04:00
|
|
|
RAILS_5_1 = '5.1'.freeze
|
2018-02-03 08:28:04 -05:00
|
|
|
RAILS_5_2 = '5.2'.freeze
|
2018-07-31 04:41:25 -04:00
|
|
|
RAILS_5_2_0 = '5.2.0'.freeze
|
2014-11-21 12:45:05 -05:00
|
|
|
|
|
|
|
RANSACK_SLASH_SEARCHES = 'ransack/searches'.freeze
|
|
|
|
RANSACK_SLASH_SEARCHES_SLASH_SEARCH = 'ransack/searches/search'.freeze
|
2011-03-30 20:31:39 -04:00
|
|
|
end
|
2012-12-17 23:52:44 -05:00
|
|
|
end
|
2014-11-21 14:03:20 -05:00
|
|
|
|