Sha256: ef634ca389a5a45cdc67ce6af144c90ea4572ce4fe1496f79f34385c605475af

Contents?: true

Size: 301 Bytes

Versions: 6

Compression:

Stored size: 301 Bytes

Contents

class Ahoy::Event
  include Mongoid::Document

  # associations
  belongs_to :visit, index: true
  belongs_to :user, index: true<%= rails5? ? ", optional: true" : nil %>

  # fields
  field :name, type: String
  field :properties, type: Hash
  field :time, type: Time

  index({name: 1, time: 1})
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ahoy_matey-2.2.1 lib/generators/ahoy/templates/mongoid_event_model.rb.tt
ahoy_matey-2.2.0 lib/generators/ahoy/templates/mongoid_event_model.rb.tt
ahoy_matey-2.1.0 lib/generators/ahoy/templates/mongoid_event_model.rb
ahoy_matey-2.0.2 lib/generators/ahoy/templates/mongoid_event_model.rb
ahoy_matey-2.0.1 lib/generators/ahoy/templates/mongoid_event_model.rb
ahoy_matey-2.0.0 lib/generators/ahoy/templates/mongoid_event_model.rb