Module: MotionRecord::ScopeHelpers::ClassMethods
- Defined in:
- lib/motion_record/scope_helpers.rb
Instance Method Summary collapse
- #average(column) ⇒ Object
-
#count(column = nil) ⇒ Object
Calculations.
- #delete_all ⇒ Object
-
#exists? ⇒ Boolean
Read-only queries.
- #find(id) ⇒ Object
- #find_all ⇒ Object
- #first ⇒ Object
- #limit(limit_value) ⇒ Object
- #maximum(column) ⇒ Object
- #minimum(column) ⇒ Object
- #order(ordering_term) ⇒ Object
- #pluck(attribute) ⇒ Object
- #sum(column) ⇒ Object
-
#update_all(params) ⇒ Object
Persistence queries.
-
#where(conditions = {}) ⇒ Object
Scope building.
Instance Method Details
#average(column) ⇒ Object
64 65 66 |
# File 'lib/motion_record/scope_helpers.rb', line 64 def average(column) scoped.average(column) end |
#count(column = nil) ⇒ Object
Calculations
48 49 50 |
# File 'lib/motion_record/scope_helpers.rb', line 48 def count(column=nil) scoped.count(column) end |
#delete_all ⇒ Object
42 43 44 |
# File 'lib/motion_record/scope_helpers.rb', line 42 def delete_all scoped.delete_all end |
#exists? ⇒ Boolean
Read-only queries
16 17 18 |
# File 'lib/motion_record/scope_helpers.rb', line 16 def exists? scoped.exists? end |
#find(id) ⇒ Object
24 25 26 |
# File 'lib/motion_record/scope_helpers.rb', line 24 def find(id) scoped.find(id) end |
#find_all ⇒ Object
28 29 30 |
# File 'lib/motion_record/scope_helpers.rb', line 28 def find_all scoped.find_all end |
#first ⇒ Object
20 21 22 |
# File 'lib/motion_record/scope_helpers.rb', line 20 def first scoped.first end |
#limit(limit_value) ⇒ Object
78 79 80 |
# File 'lib/motion_record/scope_helpers.rb', line 78 def limit(limit_value) scoped.limit(limit_value) end |
#maximum(column) ⇒ Object
52 53 54 |
# File 'lib/motion_record/scope_helpers.rb', line 52 def maximum(column) scoped.maximum(column) end |
#minimum(column) ⇒ Object
56 57 58 |
# File 'lib/motion_record/scope_helpers.rb', line 56 def minimum(column) scoped.minimum(column) end |
#order(ordering_term) ⇒ Object
74 75 76 |
# File 'lib/motion_record/scope_helpers.rb', line 74 def order(ordering_term) scoped.order(ordering_term) end |
#pluck(attribute) ⇒ Object
32 33 34 |
# File 'lib/motion_record/scope_helpers.rb', line 32 def pluck(attribute) scoped.pluck(attribute) end |
#sum(column) ⇒ Object
60 61 62 |
# File 'lib/motion_record/scope_helpers.rb', line 60 def sum(column) scoped.sum(column) end |
#update_all(params) ⇒ Object
Persistence queries
38 39 40 |
# File 'lib/motion_record/scope_helpers.rb', line 38 def update_all(params) scoped.update_all(params) end |
#where(conditions = {}) ⇒ Object
Scope building
70 71 72 |
# File 'lib/motion_record/scope_helpers.rb', line 70 def where(conditions={}) scoped.where(conditions) end |