wisper-activerecord icon indicating copy to clipboard operation
wisper-activerecord copied to clipboard

Bump to 1.1.0: Add new callback methods

Open gregpardo opened this issue 7 years ago • 2 comments

Update tests to validate working. Update ruby version to 2.5.1

gregpardo avatar Jun 12 '18 15:06 gregpardo

Thanks for this! Can you tell me a bit about the use case for broadcasting in the before callbacks?

It looks like the specs are failing for ActiveRecord 3.0 because it doesn't have the #update method.

Not sure why the JRuby specs are failing, looks unrelated.

krisleech avatar Jun 13 '18 08:06 krisleech

@krisleech I'm not sure if its a use case for everyone. In my application I abstracted all the activerecord callbacks out into the service layout using this. Sometimes I want to mutate a model before it is saved. My base service object sends these broadcast messages and the services listen for them and function as a normal activerecord callback would. If this is an invalid use case maybe my approach is wrong. Let me know your thoughts.

I've reverted to update_attributes.

gregpardo avatar Jun 14 '18 15:06 gregpardo