Module: Card::ActManager::EventDelay
- Included in:
- Card::ActManager
- Defined in:
- lib/card/act_manager/event_delay.rb
Overview
methods for handling delayed events
Instance Method Summary collapse
-
#contextualize_delayed_event(act_id, card, env, auth) ⇒ Object
If active jobs (and hence the integrate_with_delay events) don't run in a background process then Card::Env.deserialize! decouples the controller's params hash and the Card::Env's params hash with the effect that params changes in the CardController get lost (a crucial example are success params that are processed in CardController#soft_redirect).
-
#contextualize_for_delay(act_id, card, env, auth, &block) ⇒ Object
The whole ActManager setup is gone once we reach a integrate with delay event processed by ActiveJob.
- #delaying? ⇒ Boolean
- #with_env_and_auth(env, auth) ⇒ Object
Instance Method Details
#contextualize_delayed_event(act_id, card, env, auth) ⇒ Object
If active jobs (and hence the integrate_with_delay events) don't run in a background process then Card::Env.deserialize! decouples the controller's params hash and the Card::Env's params hash with the effect that params changes in the CardController get lost (a crucial example are success params that are processed in CardController#soft_redirect)
11 12 13 14 15 16 17 |
# File 'lib/card/act_manager/event_delay.rb', line 11 def contextualize_delayed_event act_id, card, env, auth if contextualize_for_delay(act_id, card, env, auth) { yield } else yield end end |
#contextualize_for_delay(act_id, card, env, auth, &block) ⇒ Object
The whole ActManager setup is gone once we reach a integrate with delay event processed by ActiveJob. This is the improvised resetup to get subcards working.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/card/act_manager/event_delay.rb', line 28 def contextualize_for_delay act_id, card, env, auth, &block self.act = Act.find act_id if act_id with_env_and_auth env, auth do return yield unless act run_act(act.card || card) do act_card.director.run_delayed_event act, &block end end end |