Sha256: fe476877023fe0f1c491ef9e9a965bdf59964fb682c6d5f8f917ceae62d21a00
Contents?: true
Size: 490 Bytes
Versions: 22
Compression:
Stored size: 490 Bytes
Contents
class Event include Mongoid::Document field :title field :date, :type => Date references_and_referenced_in_many \ :administrators, :class_name => 'Person', :inverse_of => :administrated_events, :dependent => :nullify referenced_in :owner def self.each_day(start_date, end_date) groups = only(:date).asc(:date).where(:date.gte => start_date, :date.lte => end_date).group groups.each do |hash| yield(hash["date"], hash["group"]) end end end
Version data entries
22 entries across 22 versions & 4 rubygems