I have the following autogenerated controller in conrollers/v2/base_controller.rb.
class V2::BaseController < ApplicationController
end
It was generated by Versionist gem. I am trying to make a controller inherited from V2::BaseController
. I wrote
class V2::MainController < V2::BaseController
def index
render :text => 'abcde'
end
end
It works fine and I can see my text rendered in browser. However, RubyMine IDE complains that the class name V2
in V2::MainController
is too short and I should rename the class.
I am confused because I thought that V2::
means that we define a new class inside V2
module. If I am wrong, then why does RubyMine ignore the same problem with BaseController
?
UPD: RubyMine complaint
RubyMine uses reek
for code smell detection.
Warning it's giving you is called Uncommunicative Module Name.
Uncommunicative Module Name checks for:
- 1-character names
- any name ending with a number
In your case warning was caused with 2
in V2
. Even for Version2
it would be the same.
But it's actually only a recommendation. Ruby works fine with this code.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments