-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip track without modifier #140
base: master
Are you sure you want to change the base?
Conversation
Why wouldn't one add a presence validator that makes the modifier required instead of doing all this work? Assuming that doesn't do the job, this needs tests to be merged. Also squash the commits, please. |
@dblock it's not about validation of |
Right, if the object is not |
This is useful for testing when you are creating Factories that don't need history tracking. I believe the intent of this pull request is to allow models to be updated without tracking history. I would also like to make validation optional and if the modifier is missing then skip saving history. |
All I am saying is that this logic should be expressed differently than with an |
I'm having a terrible time getting this to work with FactoryGirl and embedded documents. I've tried adding This is my suggestion: updates without modifiers should work without |
@reedlaw Could you write a spec showing what you mean by "having a terrible time getting it to work with ..."? |
@dblock I could write a spec for FactoryGirl that shows the problem with creating invalid embedded documents, but the change I made to |
@reedlaw LMK if you're interested in finishing this, I can help out. The implementation as it stands I don't think is what we want, see comments above. |
@dblock thanks for following up. here's a case where the intend of this PR will be useful: records are automatically created by the system (hence, there should be no modifier) Currently, it requires modifier to be present. Yes, we don't want to disable all validations with For example,
Still quite new to this repo. I tried to edit some code but haven't wrapped my head around it |
One thought would be to allow So I would be ok with |
Hi,
This update introduces the possibility to not save tracks when modifier of the model being changed is not set. This comes handy in case the models get updated in many places on backend, but we only need to track changes made by users.