You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking to implement query tags for activerecord when it's used inside a grape API class. One of the things I am looking into is a way to populate a context for the query tags callback inside the grape before callback.
It would be awesome if we could inject such callbacks into all Grape::API classes configuring them once. Sort of what Rails allows with their railties system.
The text was updated successfully, but these errors were encountered:
Does subclassing Grape::API into MyGrape::API < Grape::API, using that everywhere and adding the hooks not work?
it does 👍 This is honestly a half baked idea but I was thinking we could have something "configured" globally. The use case is to be able to inject information into a global singleton like ActiveSupport::ExecutionContext that is inturn used by active record query log tags
I am not against it. Generally globals are useful when authoring libraries that can be composed, and I can definitely see the use case that you provided as a valid one - include gem 'grape-active-record-query-log-tags' to get query log tags in all your Grape APIs.
I am looking to implement query tags for activerecord when it's used inside a grape API class. One of the things I am looking into is a way to populate a context for the query tags callback inside the grape before callback.
It would be awesome if we could inject such callbacks into all
Grape::API
classes configuring them once. Sort of what Rails allows with their railties system.The text was updated successfully, but these errors were encountered: