aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2019-01-09 12:00:08 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2019-01-09 12:00:08 +0900
commit5df737b7e8bb8843c55957a2aa036b3970059029 (patch)
tree67384fda5c75488da5cab1b0cba4531974596e2e
parentee3ebc90983857f5ace8e0fea787c45e0192f144 (diff)
downloadrails-5df737b7e8bb8843c55957a2aa036b3970059029.tar.gz
rails-5df737b7e8bb8843c55957a2aa036b3970059029.tar.bz2
rails-5df737b7e8bb8843c55957a2aa036b3970059029.zip
Enable `Lint/DeprecatedClassMethods` cop to avoid using deprecated methods
-rw-r--r--.rubocop.yml3
-rw-r--r--actiontext/lib/templates/installer.rb2
2 files changed, 4 insertions, 1 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 838b3d0bee..e5239063ac 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -191,6 +191,9 @@ Lint/StringConversionInInterpolation:
Lint/UriEscapeUnescape:
Enabled: true
+Lint/DeprecatedClassMethods:
+ Enabled: true
+
Style/ParenthesesAroundCondition:
Enabled: true
diff --git a/actiontext/lib/templates/installer.rb b/actiontext/lib/templates/installer.rb
index ee5a5af75b..dc549a8af3 100644
--- a/actiontext/lib/templates/installer.rb
+++ b/actiontext/lib/templates/installer.rb
@@ -14,7 +14,7 @@ run "yarn add https://github.com/rails/actiontext"
APPLICATION_PACK_PATH = "app/javascript/packs/application.js"
-if File.exists?(APPLICATION_PACK_PATH) && File.read(APPLICATION_PACK_PATH) !~ /import "actiontext"/
+if File.exist?(APPLICATION_PACK_PATH) && File.read(APPLICATION_PACK_PATH) !~ /import "actiontext"/
say "Adding import to default JavaScript pack"
append_to_file APPLICATION_PACK_PATH, <<-EOS
import "actiontext"