0.0.6 • Published 6 years ago

ransack-query-builder v0.0.6

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
6 years ago

Ransack Query Builder

Ransack

How to use?

see example

Matchers

FilterMatch toDescriptionNotes
eq*_eqequal
notEq*_not_eqnot equal
matches*_matchesmatches with LIKEe.g. q[email_matches]=%@gmail.com
doesNotMatch*_does_not_matchdoes not match with LIKE
matchesAny*_matches_anyMatches any
matchesAll*_matches_allMatches all
doesNotMatchAny*_does_not_match_anyDoes not match any
doesNotMatchAll*_does_not_match_allDoes not match all
lt*_ltless than
ltEq*_lteqless than or equal
gt*_gtgreater than
gtEq*_gteqgreater than or equal
present*_presentnot null and not emptyOnly compatible with string columns. Example: q[name_present]=1 (SQL: col is not null AND col != '')
blank*_blankis null or empty.(SQL: col is null OR col = '')
null*_nullis null
notNull*_not_nullis not null
in*_inmatch any values in arraye.g. q[name_in][]=Alice&q[name_in][]=Bob
notIn*_not_inmatch none of values in array
ltAny*_lt_anyLess than anySQL: col < value1 OR col < value2
ltEqAny*_lteq_anyLess than or equal to any
gtAny*_gt_anyGreater than any
gtEqAny*_gteq_anyGreater than or equal to any
ltAll*_lt_allLess than allSQL: col < value1 AND col < value2
ltEqAll*_lteq_allLess than or equal to all
gtAll*_gt_allGreater than all
gtEqAll*_gteq_allGreater than or equal to all
notEqAll*_not_eq_allnone of values in a set
start*_startStarts withSQL: col LIKE 'value%'
notStart*_not_startDoes not start with
startAny*_start_anyStarts with any of
startAll*_start_allStarts with all of
notStartAny*_not_start_anyDoes not start with any of
notStartAll*_not_start_allDoes not start with all of
end*_endEnds withSQL: col LIKE '%value'
notEnd*_not_endDoes not end with
endAny*_end_anyEnds with any of
endAll*_end_allEnds with all of
notEndAny*_not_end_any
notEndAll*_not_end_all
cont*_contContains valueuses LIKE
contAny*_cont_anyContains any of
contAll*_cont_allContains all of
notCont*_not_contDoes not contain
notContAny*_not_cont_anyDoes not contain any of
notContAll*_not_cont_allDoes not contain all of
true*_trueis true
false*_falseis false

Contributions

feel free to add issues and PRs

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago