currently in my update controller method I have:
@group.attributes = {
:title => params[:group][:title],
:description => params[:group][:description],
:password_required => params[:group][:password_required],
:password => params[:group][:password],
:archived => params[:group][:archived]
}
The problem is that this method is used in multiple places and all of these params are not always passed which results in a "nil" which causes the db commit to rollback.
How can you set attributes only when they are defined w/o having to use if blocks?
Thanks