Does any one else find it a pain in the butt that in the new edge
rails the Model.update method has been made private so throws an error
if you use it.
Most of the time i find i need to do work on POST params[] before i
save them back to the database.
I was doing it like this which seemed really nice and easy;
@widget = Widget.find(params[:id])
@widget.title = “NEW TITLE”
@widget.description = params[:description]
@widget.edited_by = session[:user_id]
@widget.update()
now with edge rails it would seem the only way to do this is (as the
update method is private):
@widget = Widget.find(params[:id])
@var = []
@var[:title] = “NEW TITLE”
@var[:description] = params[:description]
@var[:edited_by] = session[:user_id]
@widget.update_attributes(@var)
Which looks like crap and takes longer to write …or am i missing
something?
It seems that the update_attributes method calls the update method
internally anyway so was just wondering why they changed this.