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

Methods included from Card::Set

abstract_set?, all_set?, card_accessor, card_reader, card_writer, clean_empty_module_from_hash, clean_empty_modules, define_active_job, define_event_method, define_event_perform_later_method, define_on_format, ensure_set, event, extended, format, process_base_module_list, process_base_modules, register_set, register_set_format, shortname, view, write_tmp_file

Instance Method Details

#act_cardObject



58
59
60
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 58

def act_card
  @supercard || self
end

#followable?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 63

def followable?
  true
end

#notable_change?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 67

def notable_change?
  !silent_change && !supercard && current_act && Card::Auth.current_id != WagnBotID && followable?
end

#notify_followersObject



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 87

def notify_followers
  begin
    @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. and follower != @current_act.actor
        follower..send_change_notice @current_act, reason[:set_card].name, reason[:option]
      end
    end
  rescue =>e  #this error handling should apply to all extend callback exceptions
    Rails.logger.info "\nController exception: #{e.message}"
    Card::Error.current = e
    notable_exception_raised
  end
end