module MotionRecord::ScopeHelpers::ClassMethods

Public Instance Methods

average(column) click to toggle source
# File lib/motion_record/scope_helpers.rb, line 64
def average(column)
  scoped.average(column)
end
count(column=nil) click to toggle source

Calculations

# File lib/motion_record/scope_helpers.rb, line 48
def count(column=nil)
  scoped.count(column)
end
delete_all() click to toggle source
# File lib/motion_record/scope_helpers.rb, line 42
def delete_all
  scoped.delete_all
end
exists?() click to toggle source

Read-only queries

# File lib/motion_record/scope_helpers.rb, line 16
def exists?
  scoped.exists?
end
find(id) click to toggle source
# File lib/motion_record/scope_helpers.rb, line 24
def find(id)
  scoped.find(id)
end
find_all() click to toggle source
# File lib/motion_record/scope_helpers.rb, line 28
def find_all
  scoped.find_all
end
first() click to toggle source
# File lib/motion_record/scope_helpers.rb, line 20
def first
  scoped.first
end
limit(limit_value) click to toggle source
# File lib/motion_record/scope_helpers.rb, line 78
def limit(limit_value)
  scoped.limit(limit_value)
end
maximum(column) click to toggle source
# File lib/motion_record/scope_helpers.rb, line 52
def maximum(column)
  scoped.maximum(column)
end
minimum(column) click to toggle source
# File lib/motion_record/scope_helpers.rb, line 56
def minimum(column)
  scoped.minimum(column)
end
order(ordering_term) click to toggle source
# File lib/motion_record/scope_helpers.rb, line 74
def order(ordering_term)
  scoped.order(ordering_term)
end
pluck(attribute) click to toggle source
# File lib/motion_record/scope_helpers.rb, line 32
def pluck(attribute)
  scoped.pluck(attribute)
end
sum(column) click to toggle source
# File lib/motion_record/scope_helpers.rb, line 60
def sum(column)
  scoped.sum(column)
end
update_all(params) click to toggle source

Persistence queries

# File lib/motion_record/scope_helpers.rb, line 38
def update_all(params)
  scoped.update_all(params)
end
where(conditions={}) click to toggle source

Scope building

# File lib/motion_record/scope_helpers.rb, line 70
def where(conditions={})
  scoped.where(conditions)
end

Protected Instance Methods

scoped() click to toggle source
# File lib/motion_record/scope_helpers.rb, line 84
def scoped
  Scope.new(self)
end