方法
实例公共方法
identified_by(*identifiers) 链接
将键标记为连接标识符索引,以后可用于再次查找特定连接。常见标识符为 current_user 和 current_account,但实际上可以是任何内容。
请注意,标记为标识符的任何内容都会在从连接创建的任何频道实例上自动创建同名委托。
来源: 显示 | 在 GitHub 上
# File actioncable/lib/action_cable/connection/identification.rb, line 20 def identified_by(*identifiers) Array(identifiers).each { |identifier| attr_accessor identifier } self.identifiers += identifiers end