Skip to content

Instantly share code, notes, and snippets.

@jimsynz
Last active December 31, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimsynz/8029806 to your computer and use it in GitHub Desktop.
Save jimsynz/8029806 to your computer and use it in GitHub Desktop.
Super weirdness:
[1] pry(main)> project = Fabricate(:project_with_attachments)
=> #<Project _id: Lo2ekuTh, created_at: 2013-12-18 04:28:41 UTC, updated_at: 2013-12-18 04:28:41 UTC, design: "design.brd", top_image: "i.png", bottom_image: "i.png", user_id: nil, upload_id: nil, license_id: nil, parent_project_id: nil, name: "Aliquam molestias id.", description: "Vel accusamus reiciendis officia voluptate.\nSed nihil sequi.", short_description: nil, notes: nil, version: nil, state: "CREATING", price: "3.9", email: "louvenia@gmail.com", width_in_mils: 1024, height_in_mils: 768, pcb_layers: 2, shared_at: nil, share_setup_state: nil>
[2] pry(main)> project.layers.size
=> 8
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (1.3313ms)
MOPED: 127.0.0.1:27017 INSERT database=playground_development collection=projects documents=[{"state"=>"CREATING", "price"=>"3.9", "width_in_mils"=>1024, "height_in_mils"=>768, "pcb_layers"=>2, "name"=>"Aliquam molestias id.", "description"=>"Vel accusamus reiciendis officia voluptate.\nSed nihil sequi.", "email"=>"louvenia@gmail.com", "_id"=>"Lo2ekuTh", "design"=>"design.brd", "top_image"=>"i.png", "bottom_image"=>"i.png", "updated_at"=>2013-12-18 04:28:41 UTC, "created_at"=>2013-12-18 04:28:41 UTC, "layers"=>[{"name"=>"Top Layer", "imported_from"=>"Top_Layer.ger", "_id"=>"HTTyYJbn", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"top layer.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:28:41 UTC, "created_at"=>2013-12-18 04:28:41 UTC}, {"name"=>"Bottom Layer", "imported_from"=>"Bottom_Layer.ger", "_id"=>"X5Clsh6o", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"bottom layer.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:28:41 UTC, "created_at"=>2013-12-18 04:28:41 UTC}, {"name"=>"Top Solder Mask", "imported_from"=>"Top_Solder_Mask.ger", "_id"=>"gQiLumBO", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"top solder mask.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:28:41 UTC, "created_at"=>2013-12-18 04:28:41 UTC}, {"name"=>"Bottom Solder Mask", "imported_from"=>"Bottom_Solder_Mask.ger", "_id"=>"dm7BGGeF", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"bottom solder mask.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:28:41 UTC, "created_at"=>2013-12-18 04:28:41 UTC}, {"name"=>"Top Silk Screen", "imported_from"=>"Top_Silk_Screen.ger", "_id"=>"i0mJ5b1i", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"top silk screen.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:28:41 UTC, "created_at"=>2013-12-18 04:28:41 UTC}, {"name"=>"Bottom Silk Screen", "imported_from"=>"Bottom_Silk_Screen.ger", "_id"=>"DrTnZwX1", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"bottom silk screen.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:28:41 UTC, "created_at"=>2013-12-18 04:28:41 UTC}, {"name"=>"Board Outline", "imported_from"=>"Board_Outline.ger", "_id"=>"wvJAlytW", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"board outline.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:28:41 UTC, "created_at"=>2013-12-18 04:28:41 UTC}, {"name"=>"Drills", "imported_from"=>"Drills.xln", "_id"=>"LyNTyTqr", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"drills.xln", "image"=>"i.png", "updated_at"=>2013-12-18 04:28:41 UTC, "created_at"=>2013-12-18 04:28:41 UTC}]}] flags=[] (0.7334ms)
[3] pry(main)> project.reload
=> #<Project _id: Lo2ekuTh, created_at: 2013-12-18 04:28:41 UTC, updated_at: 2013-12-18 04:28:41 UTC, design: "design.brd", top_image: "i.png", bottom_image: "i.png", user_id: nil, upload_id: nil, license_id: nil, parent_project_id: nil, name: "Aliquam molestias id.", description: "Vel accusamus reiciendis officia voluptate.\nSed nihil sequi.", short_description: nil, notes: nil, version: nil, state: "CREATING", price: "3.9", email: "louvenia@gmail.com", width_in_mils: 1024, height_in_mils: 768, pcb_layers: 2, shared_at: nil, share_setup_state: nil>
[4] pry(main)> project.layers.size
=> 8
MOPED: 127.0.0.1:27017 QUERY database=playground_development collection=projects selector={:_id=>"Lo2ekuTh"} flags=[] limit=-1 skip=0 batch_size=nil fields=nil (2.1396ms)
[1] pry(main)> project = Fabricate(:project_with_attachments)
=> #<Project _id: T6avuGyP, created_at: 2013-12-18 04:22:00 UTC, updated_at: 2013-12-18 04:22:00 UTC, design: "design.brd", top_image: "i.png", bottom_image: "i.png", user_id: nil, upload_id: nil, license_id: nil, parent_project_id: nil, name: "Deleniti magnam autem explicabo velit.", description: "Ut ex inventore nostrum quidem voluptatibus omnis.\nQuasi voluptatum asperiores est ipsum qui quam.", short_description: nil, notes: nil, version: nil, state: "CREATING", price: "3.9", email: "yvette_baumbach@yahoo.com", width_in_mils: 1024, height_in_mils: 768, pcb_layers: 2, shared_at: nil, share_setup_state: nil>
[2] pry(main)> project.layers.size
=> 8
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (2.0938ms)
MOPED: 127.0.0.1:27017 INSERT database=playground_test collection=projects documents=[{"state"=>"CREATING", "price"=>"3.9", "width_in_mils"=>1024, "height_in_mils"=>768, "pcb_layers"=>2, "name"=>"Deleniti magnam autem explicabo velit.", "description"=>"Ut ex inventore nostrum quidem voluptatibus omnis.\nQuasi voluptatum asperiores est ipsum qui quam.", "email"=>"yvette_baumbach@yahoo.com", "_id"=>"T6avuGyP", "design"=>"design.brd", "top_image"=>"i.png", "bottom_image"=>"i.png", "updated_at"=>2013-12-18 04:22:00 UTC, "created_at"=>2013-12-18 04:22:00 UTC, "layers"=>[{"name"=>"Top Layer", "imported_from"=>"Top_Layer.ger", "_id"=>"LvNgKG83", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"top layer.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:22:00 UTC, "created_at"=>2013-12-18 04:22:00 UTC}, {"name"=>"Bottom Layer", "imported_from"=>"Bottom_Layer.ger", "_id"=>"jYpGZdvj", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"bottom layer.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:22:00 UTC, "created_at"=>2013-12-18 04:22:00 UTC}, {"name"=>"Top Solder Mask", "imported_from"=>"Top_Solder_Mask.ger", "_id"=>"EvynGkg4", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"top solder mask.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:22:00 UTC, "created_at"=>2013-12-18 04:22:00 UTC}, {"name"=>"Bottom Solder Mask", "imported_from"=>"Bottom_Solder_Mask.ger", "_id"=>"LZGRv3DP", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"bottom solder mask.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:22:00 UTC, "created_at"=>2013-12-18 04:22:00 UTC}, {"name"=>"Top Silk Screen", "imported_from"=>"Top_Silk_Screen.ger", "_id"=>"Iy2tB01g", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"top silk screen.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:22:00 UTC, "created_at"=>2013-12-18 04:22:00 UTC}, {"name"=>"Bottom Silk Screen", "imported_from"=>"Bottom_Silk_Screen.ger", "_id"=>"0LPSDvPx", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"bottom silk screen.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:22:00 UTC, "created_at"=>2013-12-18 04:22:00 UTC}, {"name"=>"Board Outline", "imported_from"=>"Board_Outline.ger", "_id"=>"wrp4IrUj", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"board outline.ger", "image"=>"i.png", "updated_at"=>2013-12-18 04:22:00 UTC, "created_at"=>2013-12-18 04:22:00 UTC}, {"name"=>"Drills", "imported_from"=>"Drills.xln", "_id"=>"zdrNDTyq", "user_modified"=>false, "layer_is_default"=>false, "gerber"=>"drills.xln", "image"=>"i.png", "updated_at"=>2013-12-18 04:22:00 UTC, "created_at"=>2013-12-18 04:22:00 UTC}]}] flags=[] (2.0611ms)
[3] pry(main)> project.reload
=> #<Project _id: m63zNpw5, created_at: nil, updated_at: nil, design: nil, top_image: nil, bottom_image: nil, user_id: nil, upload_id: nil, license_id: nil, parent_project_id: nil, name: nil, description: nil, short_description: nil, notes: nil, version: nil, state: "CREATING", price: "0.0", email: nil, width_in_mils: 0, height_in_mils: 0, pcb_layers: 0, shared_at: nil, share_setup_state: nil>
[4] pry(main)> project.layers.size
=> 0
MOPED: 127.0.0.1:27017 QUERY database=playground_test collection=projects selector={:_id=>"T6avuGyP"} flags=[] limit=-1 skip=0 batch_size=nil fields=nil (0.8888ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment