Skip to content

Commit 270944b

Browse files
committed
fix rubocop errors
1 parent 8647119 commit 270944b

26 files changed

+145
-134
lines changed

.rubocop.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Metrics/BlockLength:
7070
- 'lib/tasks/linters.rake'
7171
- 'spec/rails_helper.rb'
7272
- 'spec/system/add_new_comment_spec.rb'
73-
- 'spec/system/shared/examples.rb'
73+
- 'spec/system/react_router_demo_spec.rb'
7474

7575
Metrics/ParameterLists:
7676
Max: 5
@@ -105,4 +105,3 @@ RSpec/MultipleExpectations:
105105

106106
RSpec/MultipleMemoizedHelpers:
107107
Max: 12
108-

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ group :development, :test do
6868
################################################################################
6969
# Linters and Security
7070
gem "rubocop", "1.24.1", require: false
71-
gem "rubocop-rspec", "~> 2.7"
72-
gem 'rubocop-rails'
7371
gem "rubocop-performance", "~> 1.13"
72+
gem "rubocop-rails"
73+
gem "rubocop-rspec", "~> 2.7"
7474
# Critical that require: false be set! https://github.com/brigade/scss-lint/issues/278
7575
gem "brakeman", require: false
7676
gem "bundler-audit", require: false
@@ -93,7 +93,7 @@ end
9393
group :test do
9494
gem "capybara"
9595
gem "capybara-screenshot"
96-
gem 'coveralls_reborn', '~> 0.25.0', require: false
96+
gem "coveralls_reborn", "~> 0.25.0", require: false
9797
gem "database_cleaner"
9898
gem "generator_spec"
9999
gem "launchy"

app/models/application_record.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
class ApplicationRecord < ActiveRecord::Base
4+
self.abstract_class = true
5+
end

app/models/comment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
class Comment < ActiveRecord::Base
3+
class Comment < ApplicationRecord
44
validates :author, :text, presence: true
55
after_commit { CommentRelayJob.perform_later(self) }
66
end

config/application.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class Application < Rails::Application
1717

1818
config.action_cable.allowed_request_origins = [Rails.application.secrets.action_cable_url]
1919

20-
2120
# These settings can be overridden in specific environments using the files
2221
# in config/environments, which are processed later.
2322
#

config/environments/development.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
require "active_support/core_ext/integer/time"
34

45
Rails.application.configure do
@@ -17,13 +18,13 @@
1718

1819
# Enable/disable caching. By default caching is disabled.
1920
# Run rails dev:cache to toggle caching.
20-
if Rails.root.join('tmp', 'caching-dev.txt').exist?
21+
if Rails.root.join("tmp/caching-dev.txt").exist?
2122
config.action_controller.perform_caching = true
2223
config.action_controller.enable_fragment_cache_logging = true
2324

2425
config.cache_store = :memory_store
2526
config.public_file_server.headers = {
26-
'Cache-Control' => "public, max-age=#{2.days.to_i}"
27+
"Cache-Control" => "public, max-age=#{2.days.to_i}"
2728
}
2829
else
2930
config.action_controller.perform_caching = false

config/environments/production.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
require "active_support/core_ext/integer/time"
34

45
Rails.application.configure do
@@ -23,7 +24,7 @@
2324

2425
# Disable serving static files from the `/public` folder by default since
2526
# Apache or NGINX already handles this.
26-
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
27+
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
2728

2829
# Compress CSS using a preprocessor.
2930
# config.assets.css_compressor = :sass
@@ -54,7 +55,7 @@
5455
config.log_level = :info
5556

5657
# Prepend all log lines with the following tags.
57-
config.log_tags = [ :request_id ]
58+
config.log_tags = [:request_id]
5859

5960
# Use a different cache store in production.
6061
# config.cache_store = :mem_cache_store
@@ -90,7 +91,7 @@
9091
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
9192

9293
if ENV["RAILS_LOG_TO_STDOUT"].present?
93-
logger = ActiveSupport::Logger.new(STDOUT)
94+
logger = ActiveSupport::Logger.new($stdout)
9495
logger.formatter = config.log_formatter
9596
config.logger = ActiveSupport::TaggedLogging.new(logger)
9697
end

config/environments/test.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require "active_support/core_ext/integer/time"
24

35
# The test environment is used exclusively to run your application's
@@ -18,7 +20,7 @@
1820
# Configure public file server for tests with Cache-Control for performance.
1921
config.public_file_server.enabled = true
2022
config.public_file_server.headers = {
21-
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
23+
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
2224
}
2325

2426
# Show full error reports and disable caching.

config/initializers/assets.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Be sure to restart your server when you modify this file.
44

55
# Version of your assets, change this if you want to expire all your assets.
6-
Rails.application.config.assets.version = '1.0'
6+
Rails.application.config.assets.version = "1.0"
77

88
# Add additional assets to the asset load path.
99
# Rails.application.config.assets.paths << Emoji.images_path

config/initializers/backtrace_silencers.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
# Be sure to restart your server when you modify this file.
34

45
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.

0 commit comments

Comments
 (0)