Updating a column in rails saves other column

72 Views Asked by At

When i update a column in rails it also updates other column. "Post.new" and after saving it i did a post.title = "sample" and i doing a "post.save" Here my other column is also been updated.how to solve this

1

There are 1 best solutions below

2
On

The other column which will get updated on save along with the columns you want to update is "updated_at" or "updated_on". Is you column named after this? If yes, you have to change these column names for smooth rails operation.