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
Hi, Grape::DSL::Helpers::ClassMethods#helpers evaluates helper methods in context of a given helper module, that leads to problems if that helper module is used anywhere else.
Example
helpersMyHelperModuledodefresource
...
endend
now if I include MyHelperModule anywhere else, I'll have resource method, that I don't want to include
Ok that makes total sense @vsorlov. I wonder whether this is a feature through, in Ruby if you write module MyHelperModule you'd expect it to reopen a previous one. On the other hand, we could consider modules namespaces, and maybe what you suggest has less of a surprise. I think you should make a pull request either way.
Hi,
Grape::DSL::Helpers::ClassMethods#helpers
evaluates helper methods in context of a given helper module, that leads to problems if that helper module is used anywhere else.Example
now if I include
MyHelperModule
anywhere else, I'll have resource method, that I don't want to includeUpdate:
https://github.com/ruby-grape/grape/blob/master/lib/grape/dsl/helpers.rb#L31
The text was updated successfully, but these errors were encountered: