Sha256: 01447992e95acf38bcc72a1b28735ec8228ca5fb38bc33e77694016dd5a87412
Contents?: true
Size: 1.12 KB
Versions: 14
Compression:
Stored size: 1.12 KB
Contents
window.Ransack ?= {} Ransack.predicates = eq: 'not_eq' cont: 'not_cont' matches: 'does_not_match' start: 'not_start' end: 'not_end' present: 'blank' null: 'not_null' lt: 'gteq' gt: 'lteq' in: 'not_in' true: 'false' # Setup supported predicates for each column type. Ransack.type_predicates = {} ((o, f) -> f.call o) Ransack.type_predicates, -> @text = @string = ['eq', 'cont', 'matches', 'start', 'end', 'present', 'in'] @boolean = ['true', 'null'] @integer = @float = @decimal = ['eq', 'null', 'lt', 'gt', 'in'] @date = @datetime = @time = ['eq', 'null', 'lt', 'gt'] # Setup input field types for each predicate Ransack.predicate_inputs = {} ((o, f) -> f.call o) Ransack.predicate_inputs, -> @cont = @matches = @start = @end = @in = 'string' @present = @null = @true = false @eq = @gt = @lt = (type) -> switch type when 'string','text' then 'string' when 'integer','float','decimal' then 'numeric' when 'date','datetime','time' then type else false # Hide for unhandled types. # Use a tags input for 'in' if Select2 is available if Select2? Ransack.predicate_inputs.in = 'tags'
Version data entries
14 entries across 14 versions & 1 rubygems