I was trying to update a record in the database using Object.update_attributes(:field => "parameter")
To show a simple example of what I was trying to do is this. Please see the code below
a = params["ORDERNO"].to_s
b = params["TRACKNO"].to_s
@bd=Staging.where(:trackno => b , :orderno=> a)
if @bd.nil?
puts "not found"
else
@bd.update_attributes(:field_name => "PARAMETER")
end
I also tried @bd.first.update_attributes(::field_name => "PARAMETER")
A possible solution for this
use
update_all(:field_name => "PARAMETER")