Fix Style/MutableConstant offenses
This commit is contained in:
parent
bc5fb76c09
commit
3f9289d141
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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] }
|
||||
|
||||
|
|
|
@ -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?
|
||||
|
|
Loading…
Reference in New Issue