Add hash to serialized column

Hey guys,

I’m trying to merge a hash with another using the .merge! function.

class User < ActiveRecord::Base
serialize :preferences
end

This is what I end up with in the console:

u = User.find(1)
u.preferences.merge!{:test => 1}
SyntaxError: compile error
(irb):32: syntax error, unexpected tASSOC, expecting ‘}’
u.preferences.merge!{:test => 1}
^
from (irb):32
from :0

Any ideas?

Take care.

On Oct 10, 8:22 am, Alex [email protected] wrote:

u = User.find(1)

Take care.

u.preferences.merge!({:test => 1})

Of course! Thank you very much.