Module: Card::Set::All::Notify
- Extended by:
- Card::Set
- Defined in:
- tmpsets/set/mod012-email/all/notify.rb
Defined Under Namespace
Classes: FollowerStash
Instance Method Summary collapse
- #act_card ⇒ Object
- #current_act_card? ⇒ Boolean
- #followable? ⇒ Boolean
- #notable_change? ⇒ Boolean
- #notify_followers ⇒ Object
- #silent_change ⇒ Object
- #silent_change? ⇒ Boolean
Methods included from Loader
#clean_empty_module_from_hash, #clean_empty_modules, #extended, #pattern_and_modules_from_path, #process_base_modules, #register_set, #tmp_file_template, #write_tmp_file
Methods included from Helpers
#abstract_set?, #all_set?, #shortname
Methods included from Card::Set::AdvancedApi
#attachment, #ensure_set, #stage_method
Methods included from Format
#all_set_format_mod!, #define_on_format, #format, #register_set_format, #view
Methods included from Inheritance
#include_set, #include_set_formats
Methods included from Basket
#abstract_basket, #add_to_basket, #basket
Methods included from Trait
#card_accessor, #card_reader, #card_writer
Methods included from Event
Instance Method Details
#act_card ⇒ Object
61 62 63 |
# File 'tmpsets/set/mod012-email/all/notify.rb', line 61 def act_card @supercard || self end |
#current_act_card? ⇒ Boolean
82 83 84 |
# File 'tmpsets/set/mod012-email/all/notify.rb', line 82 def current_act_card? current_act && current_act.card_id == id end |
#followable? ⇒ Boolean
65 66 67 |
# File 'tmpsets/set/mod012-email/all/notify.rb', line 65 def followable? true end |
#notable_change? ⇒ Boolean
77 78 79 80 |
# File 'tmpsets/set/mod012-email/all/notify.rb', line 77 def notable_change? !silent_change? && current_act_card? && Card::Auth.current_id != WagnBotID && followable? end |
#notify_followers ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'tmpsets/set/mod012-email/all/notify.rb', line 104 def notify_followers @current_act.reload @follower_stash ||= FollowerStash.new @current_act.actions.each do |a| next if !a.card || a.card.silent_change? @follower_stash.add_affected_card a.card end @follower_stash.each_follower_with_reason do |follower, reason| if follower.account && follower != @current_act.actor follower.account.send_change_notice @current_act, reason[:set_card].name, reason[:option] end end # this error handling should apply to all extend callback exceptions rescue => e Rails.logger.info "\nController exception: #{e.}" Card::Error.current = e notable_exception_raised end |
#silent_change ⇒ Object
69 70 71 |
# File 'tmpsets/set/mod012-email/all/notify.rb', line 69 def silent_change @silent_change || (@supercard && @supercard.silent_change) end |