ruby on rails - activerecord association preventing record from saving -
I have a direct connection between the two models: assets and updates.
Both models (unrelated methods of zero) are here:
I have a problem where an asset record will no longer update. For example a simple test:
A = asset. First; Puts one; A.description = "new"; A.save; Puts one. Puts Asset.first.description
:
"old" {} "old"
a . Correct returns, a. Errors are empty; But the changes are not left.
I tried to figure out everything in my item model through what it was, and found that if I removed the 'is_to: update' connection, then everything is fine.
But how about any other table, which has no validity, can prevent the recording from saving, is a mystery (Plus if it was a verification problem, then @asset.
In order to make the case stranger, I decided to rename the model to update my model, along with that, it worked so it is probably a reserved name for the update model. (Does not seem likely) . But I do not want to change the name of that model unless I already have so many places, so I am thinking that there should be something else which is wrong or I am missing.
Any help is appreciated. Thank you. Calling association 'updates' is a problem.
@ asset.update
But the update is an example method that is already defined ActiveRecord:
Comments
Post a Comment