|
1class FeedbackEmailJob < EmailJob
|
|
2 class SendingDisabledError < RuntimeError; end
|
|
|
|
4 self.mailer = FeedbackMailer
|
|
5 self.email = :send_feedback
|
|
|
|
7 rescue_from SendingDisabledError do
|
|
|
|
|
|
|
|
11 before_perform if: :feedback_sending_disabled? do
|
|
12 raise SendingDisabledError, "Feedback sending is currently disabled"
|
|
|
|
|
|
|
|
|
|
17 def reschedule_job(time = 1.hour.from_now)
|
|
18 self.class.set(wait_until: time).perform_later(*arguments)
|
|
|
|
|
- UtilityFunction - doesn't depend on instance state (maybe move it to another class?) » reek
- Complexity 1 » saikuro
|
21 def feedback_sending_disabled?
|
|
22 Site.disable_feedback_sending?
|
|
|
|
|