module Tsuga::Adapter::Mongoid::Base::ScopeMethods

Public Instance Methods

collect_ids() click to toggle source
# File lib/tsuga/adapter/mongoid/base.rb, line 32
def collect_ids
  pluck(:id)
end
find_by_id(id) click to toggle source
# File lib/tsuga/adapter/mongoid/base.rb, line 28
def find_by_id(id)
  find(id)
end
find_each(&block) click to toggle source
# File lib/tsuga/adapter/mongoid/base.rb, line 36
def find_each(&block)
  each(&block)
end
mass_create(new_records) click to toggle source
# File lib/tsuga/adapter/mongoid/base.rb, line 20
def mass_create(new_records)
  collection.insert(new_records.map(&:attributes))
end
mass_update(records) click to toggle source
# File lib/tsuga/adapter/mongoid/base.rb, line 24
def mass_update(records)
  records.map(&:persist!)
end