Sha256: c6e200ddf102518825642d3c3a2b15a9e7be1ab984d6f68e2a60ab176a6e5f02
Contents?: true
Size: 846 Bytes
Versions: 3
Compression:
Stored size: 846 Bytes
Contents
require "mongoid-crud" require_relative "helper/connection" require_relative "helper/models" test_a= TestA.__create__( hello: "world" ) test_b= TestB.__create__( hello: "world", world: "no", parent_id: test_a['_id'] ) test_c= TestC.__create__( hello: "embeds one", parent_id: test_a['_id'] ) test_d= TestD.__create__( hello: "embeds many in embeded one", parent_id: test_c['_id'] ) #> puts into json # [{"_id":"536b298b241548e55a000001","created_at":"2014-05-08T08:51:55+02:00","hello":"world","test_b":[{"_id":"536b298b241548e55a000002","created_at":"2014-05-08T08:51:55+02:00","hello":"world","updated_at":"2014-05-08T08:51:55+02:00","world":"no"}],"test_c":{"_id":"536b298b241548e55a000003","created_at":"2014-05-08T08:51:55+02:00","hello":"embeds one","updated_at":"2014-05-08T08:51:55+02:00"},"updated_at":"2014-05-08T08:51:55+02:00"}]
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mongoid-crud-1.2.3 | examples/create.rb |
mongoid-crud-1.2.2 | examples/create.rb |
mongoid-crud-1.2.1 | examples/create.rb |