Fix Style/MutableConstant offenses

This commit is contained in:
Paul Padier 2016-04-01 14:58:21 +09:00 committed by Jared Beck
parent bc5fb76c09
commit 3f9289d141
5 changed files with 5 additions and 14 deletions

View File

@ -71,15 +71,6 @@ Style/MultilineTernaryOperator:
- 'lib/paper_trail/has_paper_trail.rb'
- 'lib/paper_trail/reifier.rb'
# Offense count: 4
# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
- 'lib/generators/paper_trail/templates/create_versions.rb'
- 'lib/paper_trail/version_number.rb'
- 'test/dummy/app/models/widget.rb'
- 'test/unit/associations_test.rb'
# Offense count: 3
# Cop supports --auto-correct.
Style/RescueModifier:

View File

@ -5,7 +5,7 @@ class CreateVersions < ActiveRecord::Migration
MYSQL_ADAPTERS = [
"ActiveRecord::ConnectionAdapters::MysqlAdapter",
"ActiveRecord::ConnectionAdapters::Mysql2Adapter"
]
].freeze
# The largest text column available in all supported RDBMS is
# 1024^3 - 1 bytes, roughly one gibibyte. We specify a size

View File

@ -3,9 +3,9 @@ module PaperTrail
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "pre"
PRE = "pre".freeze
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".").freeze
def self.to_s
STRING

View File

@ -3,7 +3,7 @@ class Widget < ActiveRecord::Base
has_one :wotsit
has_many :whatchamajiggers, as: :owner
EXCLUDED_NAME = "Biglet"
EXCLUDED_NAME = "Biglet".freeze
validates :name, exclusion: { in: [EXCLUDED_NAME] }

View File

@ -15,7 +15,7 @@ class AssociationsTest < ActiveSupport::TestCase
"The Lobster Quadrille",
"Who Stole the Tarts?",
"Alice's Evidence"
]
].freeze
# These would have been done in test_helper.rb if using_mysql? is true
unless using_mysql?