-
Notifications
You must be signed in to change notification settings - Fork 24
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
Memoization or something else on dynamic context #22
Comments
If you think something may be broken, it would be best to submit a breaking test as a PR (either add an assertion or create another scenario). This test looks relevant: If there is an update to be made to the wiki, I think it is open so you can edit it. |
It seems that context is evaluated on `.new` instead of `.save`
Thanks @rosskevin for instructions, I created failing test... |
change after_initialize to before_create fix state-machines#22
Context should be created on save state-machines#22
Any plans to get the fix merged into master? |
I had some legacy code that works find using old state_machine-audit_trail gem.
After upgrading I noticed that when I create new objects, those initial transitions are not properly set.
On old gem I see that only on
@post.save
hook, audit trail generate context messages.But now I see that context messages are generated on
Post.new
.I can't pass all params to
Post.new post_params
since I need some calculations.Only initial params are used to create audit trail context messages.
Here is example app https://github.com/duleorlovic/state_machines-audit_trail
You can notice that hard coded name is not used in audit trail even it is before
.save
.I'm not sure if this is related to active record state-machines/state_machines-activerecord#38 or to audit_trail... anyway we need to update migration document
https://github.com/state-machines/state_machines-audit_trail/wiki/Converting-from-former-state_machine-audit_trail-to-state_machines-audit_trail
The text was updated successfully, but these errors were encountered: