Module: Hibiki::Rails::Channel::ClassMethods
- Defined in:
- lib/hibiki/rails/channel.rb
Constant Summary collapse
- HIDDEN_ACTIONS =
Lifecycle hooks, never client-invocable actions. Performing "build_graph" would rebuild the graph and leak the old root; "subscribed" would build a SECOND graph actor on the connection.
These need subtracting because ActionCable computes action_methods as "public methods this class adds": #subscribed and #unsubscribed are private on its base class, so they are never subtracted for free, and a public app-side override — the shape the ActiveRecord guide's after_commit bridge invites — is added straight back by public_instance_methods(false).
%w[build_graph subscribed unsubscribed].freeze
Instance Method Summary collapse
-
#action_methods ⇒ Object
Subtracted from #action_methods rather than through ActionCable's #internal_methods hook.
Instance Method Details
#action_methods ⇒ Object
Subtracted from #action_methods rather than through ActionCable's #internal_methods hook. That hook would work now the floor is 8.0 — it is what #action_methods subtracts — but this is deliberately left alone: it is the fix for a real vulnerability (0.3.0, when the floor still included 7.1/7.2 where #internal_methods is never consulted and an override of it was silently dead code), and it holds on every version either way. Churning security-relevant code for idiom is not a trade worth making.
59 |
# File 'lib/hibiki/rails/channel.rb', line 59 def action_methods = super - HIDDEN_ACTIONS |