Hi,

I am serializing an attribute in my model with serialize :data

The data in question is a hash defined as

{:terminal_id => terminal_id, :order_data => table_order_data, :table_id
=> table_id}

I have deployed my app on a few machines and it works well, storing the
data above in serialized format as follows:

---
:terminal_id: DellXP
:order_data: !map:ActiveSupport::HashWithIndifferentAccess
  tableID: "39"
  orderData: !map:ActiveSupport::HashWithIndifferentAccess
    items: !map:ActiveSupport::HashWithIndifferentAccess
      "0": !map:ActiveSupport::HashWithIndifferentAccess
        amount: "1"
        product: !map:ActiveSupport::HashWithIndifferentAccess
          id: "68"
          name: Club Orange
          price: "2.4"
          tax_rate: "21"
        tax_rate: "21"
        product_price: "2.4"
        total_price: "2.4"
        terminal_id: DellXP
        time_added: "1310730896520"
        serving_employee_id: "1"
        synced: "true"
        itemNumber: "1"
    total: "2.4"
:table_id: "39"
:serving_employee_id: "1"



I recently did a fresh deploy and the data is now being stored without
the !map:ActiveSupport::HashWithIndifferentAccess part, which is
breaking my app. The serialized data is now stored as:

---
:terminal_id: DellXP
:order_data:
  tableID: '1'
  orderData:
    items:
      '0':
        amount: '1'
        product:
          id: '7'
          name: Guinness Pint
          price: '3.8'
          tax_rate: '21'
        tax_rate: '21'
        product_price: '3.8'
        total_price: '3.8'
        terminal_id: DellXP
        time_added: '1310729775938'
        serving_employee_id: '1'
        synced: 'true'
        itemNumber: '1'
    total: '3.8'
:table_id: '1'
:serving_employee_id: '1'

which is different to the above (which actually worked for me)

I am not sure what is going on, as I am using the exact same codebase.

Anyone have any ideas?

thanks

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to