# Problem with symbols: Value is stored with "--- :symbolname"

**URL:** <https://www.ruby-forum.com/t/problem-with-symbols-value-is-stored-with-symbolname/104093>\
**Category:** Rails\
**Created:** [May 14, 2007, 9:27am UTC](https://www.ruby-forum.com/t/problem-with-symbols-value-is-stored-with-symbolname/104093 "2007-05-14T09:27:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![carminem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/90db22/32.png) [@carminem](https://www.ruby-forum.com/u/carminem)\
**Post date:** [May 14, 2007, 9:27am UTC](https://www.ruby-forum.com/t/problem-with-symbols-value-is-stored-with-symbolname/104093/1 "2007-05-14T09:27:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![carminem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/90db22/32.png) [@carminem](https://www.ruby-forum.com/u/carminem)\
**Post date:** [May 14, 2007, 11:39am UTC](https://www.ruby-forum.com/t/problem-with-symbols-value-is-stored-with-symbolname/104093/2 "2007-05-14T11:39:24Z")

</div>

Nevermind, just figured out that a simple “serialize(attribute\_name)” in  
the class solved the problem.

Thanks anyway.
