Skip to content

Commit f093fc6

Browse files
taglialakoic
authored andcommitted
Fix typos in ReflectionClassName Cop
1 parent 90b7d30 commit f093fc6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/rubocop/cop/rails/reflection_class_name.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Rails
1414
# # good
1515
# has_many :accounts, class_name: 'Account'
1616
class ReflectionClassName < Cop
17-
MSG = 'Use a string has value for a class_name.'.freeze
17+
MSG = 'Use a string value for `class_name`.'.freeze
1818

1919
def_node_matcher :association_with_options?, <<-PATTERN
2020
(send nil? {:has_many :has_one :belongs_to} _ (hash $...))

spec/rubocop/cop/rails/reflection_class_name_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@
99
it 'has_many' do
1010
expect_offense(<<-RUBY.strip_indent)
1111
has_many :accounts, class_name: Account, foreign_key: :account_id
12-
^^^^^^^^^^^^^^^^^^^ Use a string has value for a class_name.
12+
^^^^^^^^^^^^^^^^^^^ Use a string value for `class_name`.
1313
RUBY
1414
end
1515

1616
it '.name' do
1717
expect_offense(<<-RUBY.strip_indent)
1818
has_many :accounts, class_name: Account.name
19-
^^^^^^^^^^^^^^^^^^^^^^^^ Use a string has value for a class_name.
19+
^^^^^^^^^^^^^^^^^^^^^^^^ Use a string value for `class_name`.
2020
RUBY
2121
end
2222

2323
it 'has_one' do
2424
expect_offense(<<-RUBY.strip_indent)
2525
has_one :account, class_name: Account
26-
^^^^^^^^^^^^^^^^^^^ Use a string has value for a class_name.
26+
^^^^^^^^^^^^^^^^^^^ Use a string value for `class_name`.
2727
RUBY
2828
end
2929

3030
it 'belongs_to' do
3131
expect_offense(<<-RUBY.strip_indent)
3232
belongs_to :account, class_name: Account
33-
^^^^^^^^^^^^^^^^^^^ Use a string has value for a class_name.
33+
^^^^^^^^^^^^^^^^^^^ Use a string value for `class_name`.
3434
RUBY
3535
end
3636
end

0 commit comments

Comments
 (0)