ruby - ActiveRecord updated_at error on rails 5 -


when manually set updated_at field of model in controller follows:

el = model.find(id) el.update(updated_at: time.now, updated_by: "some_name") 

the minutes of created_at field change match of updated_at.

this not happen when write above lines of code in console.

any ideas ?

edit:

project background:

  • i using rails 5, , mysql2 gem.
  • the problem not arise when repeat commands in rails console.
  • to preform action, make ajax call server client, , function in controller performs action.

update:

the same thing happens when using:

el.update_attribute(:updated_by, "some_name") 

which should automatically handle updated_at field.

command line output:

img

i not see created_at field modified anywhere.

  • also, if relevant on windows 7, 64 bit.

update 2:

i pushed project heroku server , bug not persist. can conclude windows bug.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -