From aa757d0c1151f83104da241f30b1924d748a5d78 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Sat, 16 Apr 2016 15:19:41 +0900 Subject: don't remove `cable.js` `cable.js` is required for other Channels. --- actioncable/lib/rails/generators/channel/channel_generator.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actioncable/lib/rails/generators') diff --git a/actioncable/lib/rails/generators/channel/channel_generator.rb b/actioncable/lib/rails/generators/channel/channel_generator.rb index 3bcf5f1898..05fd21a954 100644 --- a/actioncable/lib/rails/generators/channel/channel_generator.rb +++ b/actioncable/lib/rails/generators/channel/channel_generator.rb @@ -13,7 +13,9 @@ module Rails template "channel.rb", File.join('app/channels', class_path, "#{file_name}_channel.rb") if options[:assets] - template "assets/cable.js", "app/assets/javascripts/cable.js" + if self.behavior == :invoke + template "assets/cable.js", "app/assets/javascripts/cable.js" + end template "assets/channel.coffee", File.join('app/assets/javascripts/channels', class_path, "#{file_name}.coffee") end -- cgit v1.2.3