Pass analytics to StepInfo preconditions proc#11259
Conversation
We'd like to log an event from certain preconditions procs. This just updates the proc signature to include an `analytics:` argument. [skip changelog]
| @user = user | ||
| end | ||
|
|
||
| def steps |
There was a problem hiding this comment.
Changes to this method:
- Made it public (so I could use it in a spec)
- Added
@steps ||=to the beginning so steps are cached - Added
.freezeto the object definition
There was a problem hiding this comment.
what's the purpose of the freeze? was code modifying this sneakily?
| }.freeze | ||
| end | ||
|
|
||
| def step_allowed?(key:) |
There was a problem hiding this comment.
Changes to this one:
- Made public
- Added analytics: arg
I skimmed that PR and didn't see a good thread to follow onto... so some overall feedback: I am skeptical of this approach! |
|
@zachmargolis Yeah, that's a fair point. Lemme noodle on this |
🎫 Ticket
Relates to work for LG-14393
🛠 Summary of changes
Over on #11254 there was a great suggestion to log an event when a certain step's preconditions fail. The problem was that
step_infois implemented as a static method on controllers, andanalyticsis only available to individual instances.So this PR updates the signature of the
preconditionsproc to include ananalytics:argument, and ensures that it is passed properly byIdvStepConcern.