Class: BlocRecord::Collection

Inherits:
Array
  • Object
show all
Defined in:
lib/bloc_record/collection.rb

Instance Method Summary collapse

Instance Method Details

#group(*args) ⇒ Object



8
9
10
11
# File 'lib/bloc_record/collection.rb', line 8

def group(*args)
  ids = self.map(&:id)
  self.any? ? self.first.class.group_by_ids(ids, args) : false
end

#update_all(updates) ⇒ Object



3
4
5
6
# File 'lib/bloc_record/collection.rb', line 3

def update_all(updates)
  ids = self.map(&:id)
  self.any? ? self.first.class.update(ids, updates) : false
end