Context: I'm upgrading a massive rails 3.2 API to rails 4. I'm late to the party to realise that Grape changed the default param builder.
Problem: The proposed solution for backwards compatibility:
include Grape::Extensions::Hashie::Mash::ParamBuilder can't be applied globally as far as I could investigate.
The reason for concern is that we have over 200+ API endpoints, and I'd rather not have to modify the 200 files just for the sake of maintaining backwards compatibility.
Is there anyway of setting this builder as the default builder for Grape? Just re-opening Grape::API or building a custom parent class that included Grape::Extensions::Hashie::Mash::ParamBuilder didn't cut it for me.
Using the
def self.inherited(base)
base.include Grape::Extensions::Hashie::Mash::ParamBuilder
end
didn't help either, as in some of our API's the routes hadn't been loaded by then causing some trouble.
Perhaps you've though of an approach, or a new approach must be made?
Thanks in advance for the help
Context: I'm upgrading a massive rails 3.2 API to rails 4. I'm late to the party to realise that Grape changed the default param builder.
Problem: The proposed solution for backwards compatibility:
include Grape::Extensions::Hashie::Mash::ParamBuildercan't be applied globally as far as I could investigate.The reason for concern is that we have over 200+ API endpoints, and I'd rather not have to modify the 200 files just for the sake of maintaining backwards compatibility.
Is there anyway of setting this builder as the default builder for Grape? Just re-opening Grape::API or building a custom parent class that included
Grape::Extensions::Hashie::Mash::ParamBuilderdidn't cut it for me.Using the
def self.inherited(base)base.include Grape::Extensions::Hashie::Mash::ParamBuilderenddidn't help either, as in some of our API's the routes hadn't been loaded by then causing some trouble.
Perhaps you've though of an approach, or a new approach must be made?
Thanks in advance for the help