Carmine Moleti
2007-May-14 07:27 UTC
Problem with symbols: Value is stored with "--- :symbolname"
Hi to everyone,
I''ve a problem with symbols and my application.
There are 4 fields defined as string which receive a symbol from code:
1. stato (status)
2. fase (phase)
3. spedizione (shipment)
4. pagamento (payment)
Well, only the status field shows a weird behaviour.
There is only one point, so far, in the source where I assign a value to
that
field and the code I wrote is:
def conferma
@order = Order.find(session[:ordine])
@order.stato = :confermato
@order.save!
empty_cart
end
Now, when I read back the order for display purposes, when the field
"stato" is
displayed, something like: "--- :value" is shown.
This thing doesn''t happen to the rest above mentioned fields.
Here follows the migration stuff:
create_table :orders do |t|
t.column :user_id, :integer
t.column :user_ip, :string
t.column :created_at, :timestamp
t.column :updated_at, :timestamp
t.column :stato, :string, :default => ''aperto''
t.column :fase, :string
t.column :spedizione, :string, :default => ''pacco1''
t.column :pagamento, :string, :default => ''bonifico''
t.column :indirizzo, :string
t.column :civico, :integer
t.column :cap, :integer
t.column :comune, :string
t.column :provincia, :string
t.column :telefono, :string
t.column :email, :string
t.column :note, :string
end
Is there anything I could check to fix this thing?
I''ve tried with grep on the whole source tree to find a possible flaw
in
the source code. Still, no luck.
Thanks in advance for your help.
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Carmine Moleti
2007-May-14 09:39 UTC
Re: Problem with symbols: Value is stored with "--- :symboln
Nevermind, just figured out that a simple "serialize(attribute_name)" in the class solved the problem. Thanks anyway. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---