Skip to content
  • Bart de Water's avatar
    95b6fbd0
    Stop building AS::Notifications::Event manually · 95b6fbd0
    Bart de Water authored
    It's possible since Rails 6 (3ea28579) to let the framework create Event objects, but the guides and docs weren't updated to lead with this example.
    
    Manually instantiating an Event doesn't record CPU time and allocations, I've seen it more than once that people copy-pasting the example code get confused about these stats returning 0. The tests here show that - just like the apps I've worked on - the old pattern keeps getting copy-pasted.
    95b6fbd0
    Stop building AS::Notifications::Event manually
    Bart de Water authored
    It's possible since Rails 6 (3ea28579) to let the framework create Event objects, but the guides and docs weren't updated to lead with this example.
    
    Manually instantiating an Event doesn't record CPU time and allocations, I've seen it more than once that people copy-pasting the example code get confused about these stats returning 0. The tests here show that - just like the apps I've worked on - the old pattern keeps getting copy-pasted.
Loading