Reputation: 25552
I am trying to run the update_attributes for a particular object, but everytime I try to run my script, I get the following error: TypeError (can't convert String into Integer):
Here is the code I am working with
media = Media.find(params[:media_id])
media.update_attributes({:started_encode => false, :encode_success => false, :akamai => false})
Any idea why this keeps throwing that error?
Upvotes: 1
Views: 1927
Reputation: 574
Which are the names of the Media columns table?
You may have found this problem:
http://ethernetflow.blogspot.com/2010/11/rails-typeerror-cant-convert-string.html
Basicaly, you cannot have a column named "HASH" in your table.
Upvotes: 7
Reputation: 26997
You are passing a string to a parameter that is expecting an integer, most likely in `params[:media_id]'. Try:
media = Media.find(params[:media_id].to_i)
...
Upvotes: 0