Add cop for preferring 'Foo.method' over 'Foo::method'
This commit is contained in:
parent
a5e81342af
commit
9c0c90979a
|
@ -156,3 +156,7 @@ Style/RedundantReturn:
|
|||
Style/Semicolon:
|
||||
Enabled: true
|
||||
AllowAsExpressionSeparator: true
|
||||
|
||||
# Prefer Foo.method over Foo::method
|
||||
Style/ColonMethodCall:
|
||||
Enabled: true
|
||||
|
|
|
@ -1186,7 +1186,7 @@ class CustomNameForFixtureOrModelTest < ActiveRecord::TestCase
|
|||
end
|
||||
|
||||
def test_table_name_is_defined_in_the_model
|
||||
assert_equal "randomly_named_table2", ActiveRecord::FixtureSet::all_loaded_fixtures["admin/randomly_named_a9"].table_name
|
||||
assert_equal "randomly_named_table2", ActiveRecord::FixtureSet.all_loaded_fixtures["admin/randomly_named_a9"].table_name
|
||||
assert_equal "randomly_named_table2", Admin::ClassNameThatDoesNotFollowCONVENTIONS1.table_name
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase
|
|||
Rails.application = TestApp::Application
|
||||
super
|
||||
|
||||
Kernel::silence_warnings do
|
||||
Kernel.silence_warnings do
|
||||
Thor::Base.shell.send(:attr_accessor, :always_force)
|
||||
@shell = Thor::Base.shell.new
|
||||
@shell.send(:always_force=, true)
|
||||
|
|
|
@ -9,7 +9,7 @@ module SharedGeneratorTests
|
|||
super
|
||||
Rails::Generators::AppGenerator.instance_variable_set("@desc", nil)
|
||||
|
||||
Kernel::silence_warnings do
|
||||
Kernel.silence_warnings do
|
||||
Thor::Base.shell.send(:attr_accessor, :always_force)
|
||||
@shell = Thor::Base.shell.new
|
||||
@shell.send(:always_force=, true)
|
||||
|
|
Loading…
Reference in New Issue