aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/connection
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action_cable/connection')
-rw-r--r--lib/action_cable/connection/identification.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/action_cable/connection/identification.rb b/lib/action_cable/connection/identification.rb
index 3ea3b77e56..113e41ca3f 100644
--- a/lib/action_cable/connection/identification.rb
+++ b/lib/action_cable/connection/identification.rb
@@ -11,6 +11,9 @@ module ActionCable
class_methods do
# Mark a key as being a connection identifier index that can then used to find the specific connection again later.
# Common identifiers are current_user and current_account, but could be anything really.
+ #
+ # Note that anything marked as an identifier will automatically create a delegate by the same name on any
+ # channel instances created off the connection.
def identified_by(*identifiers)
Array(identifiers).each { |identifier| attr_accessor identifier }
self.identifiers += identifiers