The salt of password can't save to MySQL


I am solving already 3 hours this weird problem:

class Func
def self.md5(string)

def self.salt(length=10)
chars = ‘abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789’
salt = ‘’
length.times { salt << chars[rand(chars.size)] }

In controller:
password = Func.md5(params[:registrace][:heslo])
passsalt = Func.salt(10)

puts password //here is it ok
puts passsalt //here is it ok
@saveit = => passsalt, // problem -- to dabase

is stored NULL
:passw => password + passsalt)
//but here is is ok, passalt contains right string

The column in database ‘Table’ for salt called ‘pass_salt’. This column
have type ‘varchar(10)’. The lenght of salt is 10 chars.
I don’t know where could be fault, but into the column ‘passw’ is
everything stored great, but to the column ‘pass_salt’ the string
contains salt does not stored…

I will glad for any help, I have no idea, where could be a problem…
Thanks a lot,

Problem solved – after 3 hours long sleep I saw it – attr_accessible.