how to create when attr_protected?

Hello,

I'm facing a small issue here with protected columns from being updated. (email, username)

So I thought attr_protected is the solution, but this destroy my creation of user?

attr_protected means you cannot assign the attribute using create (or update_attributes etc...)

It does not mean that you can't do user.email = '...'

Fred

Thanks for fast answer.

well, that's a problem then because I need to assign everything myself?

only for those attributes marked as protected.

Fred

Or you could use attr_readonly method (http://api.rubyonrails.org/ classes/ActiveRecord/Base.html#M002282).