ruby-rails-starter icon indicating copy to clipboard operation
ruby-rails-starter copied to clipboard

Duplicate definition of 'ref' method

Open bitops opened this issue 8 years ago • 1 comments

The ref method is defined in two modules, both of which are included in the project ApplicationController.

The duplicate definitions are here:

  • https://github.com/prismicio/ruby-rails-starter/blob/master/app/controllers/prismic_controller.rb#L15
  • https://github.com/prismicio/ruby-rails-starter/blob/master/app/helpers/prismic_helper.rb#L29

I believe that defining a method with the same name in two different places is at best confusing and at worst may lead to undesirable application behavior. When calling ref through the application, it's not clear which ref is being referred to without use of the debugger.

Therefore, these two methods should have different names for the sake of clarity.

bitops avatar Jun 28 '16 21:06 bitops

@erwan bump

bitops avatar Aug 10 '16 21:08 bitops