Sha256: 79ea5c7564c6f349e48d1ad343272b54214924cc250e66d5555f501dd5adae59

Contents?: true

Size: 474 Bytes

Versions: 22

Compression:

Stored size: 474 Bytes

Contents

class Game
  include Mongoid::Document
  field :high_score, :type => Integer, :default => 500
  field :score, :type => Integer, :default => 0
  field :name
  referenced_in :person, :index => true
  references_one :video, :validate => false
  accepts_nested_attributes_for :person
  cache

  validates_format_of :name, :without => /\$\$\$/

  attr_protected :_id

  set_callback(:initialize, :after) do |document|
    write_attribute("name", "Testing") unless name
  end
end

Version data entries

22 entries across 22 versions & 4 rubygems

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