Skip to content

Instantly share code, notes, and snippets.

@guyboertje
Created September 26, 2012 14:13
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 guyboertje/3788293 to your computer and use it in GitHub Desktop.
Save guyboertje/3788293 to your computer and use it in GitHub Desktop.
virtus hacks console output
h = {description: 'blah', id: '1046d670-e9ff-012f-5d84-38f6b11b6fe1', images: [1,2,3], name: 'bob', owner_id: '1005bc90-e9ff-012f-5d84-38f6b11b6fe1', creating_user_id: '1005bb10-e9ff-012f-5d84-38f6b11b6fe1', summary: 'aasdasd', tags: [1,2,3], upc: 333222}
=> {:description=>"blah", :id=>"1046d670-e9ff-012f-5d84-38f6b11b6fe1", :images=>[1, 2, 3], :name=>"bob", :owner_id=>"1005bc90-e9ff-012f-5d84-38f6b11b6fe1", :creating_user_id=>"1005bb10-e9ff-012f-5d84-38f6b11b6fe1", :summary=>"aasdasd", :tags=>[1, 2, 3], :upc=>333222}
1.9.3p194 :002 > h[:digital_commodities] = [{asset_id: '1046e450-e9ff-012f-5d84-38f6b11b6fe1', commodity_id: '10552d90-e9ff-012f-5d84-38f6b11b6fe1', from_warehouse: false, meta_data_changed: false, meta_data: {}, tags: []}]
=> [{:asset_id=>"1046e450-e9ff-012f-5d84-38f6b11b6fe1", :commodity_id=>"10552d90-e9ff-012f-5d84-38f6b11b6fe1", :from_warehouse=>false, :meta_data_changed=>false, :meta_data=>{}, :tags=>[]}]
1.9.3p194 :003 > h[:public_copy_missing] = [1,2,3,4] => [1, 2, 3, 4]
1.9.3p194 :004 > pc = ProductCreation.new(h) => #<ProductCreation:0x007f82e7bd3ff0 @description="blah", @id="1046d670-e9ff-012f-5d84-38f6b11b6fe1", @images=[1, 2, 3], @name="bob", @owner_id="1005bc90-e9ff-012f-5d84-38f6b11b6fe1", @creating_user_id="1005bb10-e9ff-012f-5d84-38f6b11b6fe1", @summary="aasdasd", @tags=[1, 2, 3], @upc=333222, @digital_commodities=[{:asset_id=>"1046e450-e9ff-012f-5d84-38f6b11b6fe1", :commodity_id=>"10552d90-e9ff-012f-5d84-38f6b11b6fe1", :from_warehouse=>false, :meta_data_changed=>false, :meta_data=>{}, :tags=>[]}], @public_copy_missing=["1", "2", "3", "4"]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment