Module: Card::Set::All::Notify
- Extended by:
- Card::Set
- Defined in:
- tmpsets/set/mod006-05_email/all/notify.rb
Defined Under Namespace
Classes: FollowerStash
Instance Method Summary collapse
- #act_card ⇒ Object
- #followable? ⇒ Boolean
- #notable_change? ⇒ Boolean
- #notify_followers ⇒ Object
- #silent_change? ⇒ Boolean
Methods included from Loader
#clean_empty_module_from_hash, #clean_empty_modules, #extended, #process_base_module_list, #process_base_modules, #register_set, #write_tmp_file
Methods included from Helpers
#abstract_set?, #all_set?, #attachment, #ensure_set, #include_set, #include_set_formats, #shortname, #stage_method
Methods included from Format
#all_set_format_mod!, #applicable_format?, #define_on_format, #each_format, #format, #register_set_format, #view
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/mod006-05_email/all/notify.rb', line 61 def act_card @supercard || self end |
#followable? ⇒ Boolean
65 66 67 |
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 65 def followable? true end |
#notable_change? ⇒ Boolean
73 74 75 76 |
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 73 def notable_change? !silent_change? && !supercard && current_act && Card::Auth.current_id != WagnBotID && followable? end |
#notify_followers ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 96 def notify_followers @current_act.reload @follower_stash ||= FollowerStash.new @current_act.actions.each do |a| @follower_stash.add_affected_card a.card if 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 |