diff options
author | Akira Matsuda <ronnie@dio.jp> | 2017-01-05 17:20:57 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2017-01-05 19:58:52 +0900 |
commit | 5473e390d362755125d2f47b64ef0a135f2fe111 (patch) | |
tree | b9c199a3c78ad307ed034cf5618e2897dfa650c6 /actioncable/lib | |
parent | 6197a38bca988f05087aa022e288922cf0331d6c (diff) | |
download | rails-5473e390d362755125d2f47b64ef0a135f2fe111.tar.gz rails-5473e390d362755125d2f47b64ef0a135f2fe111.tar.bz2 rails-5473e390d362755125d2f47b64ef0a135f2fe111.zip |
`self.` is not needed when calling its own instance method
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
Diffstat (limited to 'actioncable/lib')
-rw-r--r-- | actioncable/lib/action_cable/engine.rb | 2 | ||||
-rw-r--r-- | actioncable/lib/rails/generators/channel/channel_generator.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/actioncable/lib/action_cable/engine.rb b/actioncable/lib/action_cable/engine.rb index e23527b84e..63a26636a0 100644 --- a/actioncable/lib/action_cable/engine.rb +++ b/actioncable/lib/action_cable/engine.rb @@ -31,7 +31,7 @@ module ActionCable self.cable = Rails.application.config_for(config_path).with_indifferent_access end - previous_connection_class = self.connection_class + previous_connection_class = connection_class self.connection_class = -> { "ApplicationCable::Connection".safe_constantize || previous_connection_class.call } options.each { |k, v| send("#{k}=", v) } diff --git a/actioncable/lib/rails/generators/channel/channel_generator.rb b/actioncable/lib/rails/generators/channel/channel_generator.rb index 04b787c3a4..984b78bc9c 100644 --- a/actioncable/lib/rails/generators/channel/channel_generator.rb +++ b/actioncable/lib/rails/generators/channel/channel_generator.rb @@ -13,7 +13,7 @@ module Rails template "channel.rb", File.join("app/channels", class_path, "#{file_name}_channel.rb") if options[:assets] - if self.behavior == :invoke + if behavior == :invoke template "assets/cable.js", "app/assets/javascripts/cable.js" end @@ -30,7 +30,7 @@ module Rails # FIXME: Change these files to symlinks once RubyGems 2.5.0 is required. def generate_application_cable_files - return if self.behavior != :invoke + return if behavior != :invoke files = [ "application_cable/channel.rb", |