Sha256: 30d73d700d152bb3c83f40e0cb4ac5cd10ef222e9d8cef3f4988a2aa73bf117b

Contents?: true

Size: 350 Bytes

Versions: 22

Compression:

Stored size: 350 Bytes

Contents

class Birthday
  include Mongoid::Document
  field :title
  field :date, :type => Date
  embedded_in :owner, :inverse_of => :birthdays

  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 |date, group|
      yield(date, group)
    end
  end
end

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
mongoid_spacial-0.2.17 spec/models/birthday.rb
sig_mongoid_spacial-0.2.17 spec/models/birthday.rb
cb_mongoid_spacial-0.2.16 spec/models/birthday.rb
mongoid_geospatial-1.0.0 spec/models/birthday.rb
mongoid_geospatial-1.0.0rc1 spec/models/birthday.rb
mongoid_geospatial-1.0.0rc0 spec/models/birthday.rb
mongoid_spacial-0.2.16 spec/models/birthday.rb
mongoid_spacial-0.2.13 spec/models/birthday.rb
mongoid_spacial-0.2.12 spec/models/birthday.rb
mongoid_spacial-0.2.11 spec/models/birthday.rb
mongoid_spacial-0.2.10 spec/models/birthday.rb
mongoid_spacial-0.2.8 spec/models/birthday.rb
mongoid_spacial-0.2.7 spec/models/birthday.rb
mongoid_spacial-0.2.6 spec/models/birthday.rb
mongoid_spacial-0.2.5 spec/models/birthday.rb
mongoid_spacial-0.2.4 spec/models/birthday.rb
mongoid_spacial-0.2.3 spec/models/birthday.rb
mongoid_spacial-0.2.2 spec/models/birthday.rb
mongoid_spacial-0.2.0 spec/models/birthday.rb
mongoid_spacial-0.1.1 spec/models/birthday.rb