From 5473e390d362755125d2f47b64ef0a135f2fe111 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 5 Jan 2017 17:20:57 +0900 Subject: `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 --- actioncable/lib/action_cable/engine.rb | 2 +- actioncable/lib/rails/generators/channel/channel_generator.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'actioncable/lib') 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", -- cgit v1.2.3