Skip to content

Memoization or something else on dynamic context #22

@duleorlovic

Description

@duleorlovic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions