On Feb 23, 2011, at 11:03 AM, Bhasker Harihara wrote:

This is what I have and it gives the error.

 validates :uname,  :presence => true,
                    :length   => { :maximum => 50 }

puts "The name is set to #{user.uname}"

But without the puts it updates the record into the databse. I think it is to do with scoping. If have this puts after make salt then I have no problem

If you're inside of user.rb, then user.uname won't have any context. Try self.uname or just uname, and see if that works.

Walter

--
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to