Sha256: bee7b96724c9d694d8a8a5ec387938d6bba5e316b80e16360ef675f39499b8ad

Contents?: true

Size: 471 Bytes

Versions: 17

Compression:

Stored size: 471 Bytes

Contents

require './helper'

class TypeEx
  include MongoMapper::Document

  key :time, Timestamp
  key :config, OpenStruct
  key :set, Set
end


type = TypeEx.new(:set => Set.new, :config => OpenStruct.new)

type.config.name = "Alan"
type.config.last_name = "Turing"


type.time = Time.now
type.set += [1,1,2,3,2,2]

type.save

from_db = TypeEx.find(type.id)

puts from_db.config.inspect
puts from_db.set.inspect

Time.zone = "Hawaii"
puts from_db.time.inspect

from_db.destroy

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mongomapper_ext-0.5.2 examples/types.rb
mongomapper_ext-0.5.1 examples/types.rb
mongomapper_ext-0.5.0 examples/types.rb
mongomapper_ext-0.4.0 examples/types.rb
mongomapper_ext-0.3.0 examples/types.rb
mongomapper_ext-0.2.4 examples/types.rb
mongomapper_ext-0.2.3 examples/types.rb
mongomapper_ext-0.2.2 examples/types.rb
mongomapper_ext-0.2.1 examples/types.rb
mongomapper_ext-0.2.0 examples/types.rb
mongomapper_ext-0.1.5 examples/types.rb
mongomapper_ext-0.1.4 examples/types.rb
mongomapper_ext-0.1.3 examples/types.rb
mongomapper_ext-0.1.2 examples/types.rb
mongomapper_ext-0.1.1 examples/types.rb
mongomapper_ext-0.1.0 examples/types.rb
mongomapper_ext-0.0.4 examples/types.rb