CBusBus CBusBus - 3 years ago 104
Ruby Question

Ruby, ActiveRecord: Local rails server updates record attributes whereas the remote server does not

I have a script which sends data from a Windows back end to Heroku. Recently I added four new columns to the object model. For testing each of the properties is updated individually through a cURL request.

On the local rails server (which is identical to the Heroku hosted server) all four new attributes are populated correctly and there are no errors in the logs.

On the Heroku based server when I run the back end script it updates two of the columns but not the other two. In spite of these values not being populated the logs indicate that the process ran successfully with status of 200.

Has anyone experienced something similar to this?

Answer Source

Ok, managed to resolve this issue.

The solution was to run heroku restart. Seemingly since Heroku apps are precompiled the new columns were not being recognised by the app.

Peculiarly, the app should've probably raised an UnknownAttributeError before the fix was applied.

Cheers, CBusBus.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download