Module: Ransack::Adapters::Mongoid::Attributes::Predications

Included in:
Attribute
Defined in:
lib/ransack/adapters/mongoid/attributes/predications.rb

Instance Method Summary collapse

Instance Method Details

#does_not_match(other) ⇒ Object


66
67
68
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 66

def does_not_match(other)
  { "$not" => { name => /#{other}/i } }.to_inquiry
end

#does_not_match_all(others) ⇒ Object


74
75
76
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 74

def does_not_match_all(others)
  grouping_all :does_not_match, others
end

#does_not_match_any(others) ⇒ Object


70
71
72
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 70

def does_not_match_any(others)
  grouping_any :does_not_match, others
end

#eq(other) ⇒ Object


18
19
20
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 18

def eq(other)
  { name => other }.to_inquiry
end

#eq_all(others) ⇒ Object


26
27
28
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 26

def eq_all(others)
  grouping_all :eq, others
end

#eq_any(others) ⇒ Object


22
23
24
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 22

def eq_any(others)
  grouping_any :eq, others
end

#gt(right) ⇒ Object


90
91
92
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 90

def gt(right)
  { name => { '$gt' => right } }.to_inquiry
end

#gt_all(others) ⇒ Object


98
99
100
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 98

def gt_all(others)
  grouping_all :gt, others
end

#gt_any(others) ⇒ Object


94
95
96
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 94

def gt_any(others)
  grouping_any :gt, others
end

#gteq(right) ⇒ Object


78
79
80
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 78

def gteq(right)
  { name => { '$gte' => right } }.to_inquiry
end

#gteq_all(others) ⇒ Object


86
87
88
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 86

def gteq_all(others)
  grouping_all :gteq, others
end

#gteq_any(others) ⇒ Object


82
83
84
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 82

def gteq_any(others)
  grouping_any :gteq, others
end

#in(other) ⇒ Object


30
31
32
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 30

def in(other)
  { name => { "$in" => other } }.to_inquiry
end

#in_all(others) ⇒ Object


38
39
40
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 38

def in_all(others)
  grouping_all :in, others
end

#in_any(others) ⇒ Object


34
35
36
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 34

def in_any(others)
  grouping_any :in, others
end

#lt(right) ⇒ Object


102
103
104
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 102

def lt(right)
  { name => { '$lt' => right } }.to_inquiry
end

#lt_all(others) ⇒ Object


110
111
112
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 110

def lt_all(others)
  grouping_all :lt, others
end

#lt_any(others) ⇒ Object


106
107
108
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 106

def lt_any(others)
  grouping_any :lt, others
end

#lteq(right) ⇒ Object


114
115
116
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 114

def lteq(right)
  { name => { '$lte' => right } }.to_inquiry
end

#lteq_all(others) ⇒ Object


122
123
124
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 122

def lteq_all(others)
  grouping_all :lteq, others
end

#lteq_any(others) ⇒ Object


118
119
120
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 118

def lteq_any(others)
  grouping_any :lteq, others
end

#matches(other) ⇒ Object


54
55
56
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 54

def matches(other)
  { name => /#{other}/i }.to_inquiry
end

#matches_all(others) ⇒ Object


62
63
64
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 62

def matches_all(others)
  grouping_all :matches, others
end

#matches_any(others) ⇒ Object


58
59
60
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 58

def matches_any(others)
  grouping_any :matches, others
end

#not_eq(other) ⇒ Object


6
7
8
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 6

def not_eq(other)
  { name => { '$ne' => other } }.to_inquiry
end

#not_eq_all(others) ⇒ Object


14
15
16
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 14

def not_eq_all(others)
  grouping_all :not_eq, others
end

#not_eq_any(others) ⇒ Object


10
11
12
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 10

def not_eq_any(others)
  grouping_any :not_eq, others
end

#not_in(other) ⇒ Object


42
43
44
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 42

def not_in(other)
  { "$not" => { name => { "$in" => other } } }.to_inquiry
end

#not_in_all(others) ⇒ Object


50
51
52
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 50

def not_in_all(others)
  grouping_all :not_in, others
end

#not_in_any(others) ⇒ Object


46
47
48
# File 'lib/ransack/adapters/mongoid/attributes/predications.rb', line 46

def not_in_any(others)
  grouping_any :not_in, others
end