Class: ActiveRecord::QueryMethods::WhereChain
- Inherits:
-
Object
- Object
- ActiveRecord::QueryMethods::WhereChain
- Defined in:
- lib/postgres_ext/active_record/relation/query_methods.rb
Instance Method Summary collapse
- #all(opts) ⇒ Object
- #any(opts) ⇒ Object
- #contained_within(opts) ⇒ Object
- #contained_within_or_equals(opts) ⇒ Object
- #contains(opts) ⇒ Object
- #contains_or_equals(opts) ⇒ Object
- #overlap(opts) ⇒ Object
Instance Method Details
#all(opts) ⇒ Object
49 50 51 |
# File 'lib/postgres_ext/active_record/relation/query_methods.rb', line 49 def all(opts) equality_to_function('ALL', opts) end |
#any(opts) ⇒ Object
45 46 47 |
# File 'lib/postgres_ext/active_record/relation/query_methods.rb', line 45 def any(opts) equality_to_function('ANY', opts) end |
#contained_within(opts) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/postgres_ext/active_record/relation/query_methods.rb', line 13 def contained_within(opts) opts.each do |key, value| @scope = @scope.where(arel_table[key].contained_within(value)) end @scope end |
#contained_within_or_equals(opts) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/postgres_ext/active_record/relation/query_methods.rb', line 21 def contained_within_or_equals(opts) opts.each do |key, value| @scope = @scope.where(arel_table[key].contained_within_or_equals(value)) end @scope end |
#contains(opts) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/postgres_ext/active_record/relation/query_methods.rb', line 29 def contains(opts) opts.each do |key, value| @scope = @scope.where(arel_table[key].contains(value)) end @scope end |
#contains_or_equals(opts) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/postgres_ext/active_record/relation/query_methods.rb', line 37 def contains_or_equals(opts) opts.each do |key, value| @scope = @scope.where(arel_table[key].contains_or_equals(value)) end @scope end |
#overlap(opts) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/postgres_ext/active_record/relation/query_methods.rb', line 6 def overlap(opts) opts.each do |key, value| @scope = @scope.where(arel_table[key].overlap(value)) end @scope end |