Skip to content

Grape::DSL::Helpers::ClassMethods#helpers modifies helper module #1335

Description

@sevaorlov

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

helpers MyHelperModule do
  def resource
    ...
  end
end

now if I include MyHelperModule anywhere else, I'll have resource method, that I don't want to include

Update:
https://github.com/ruby-grape/grape/blob/master/lib/grape/dsl/helpers.rb#L31

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions