Skip to Content Skip to Search
Methods
C
M
R
S

Constants

ACCOUNT_ACTIONS = %w[ accepted_invitation account_created log_in log_out card_updated changed_email customer_deleted reset_password ].freeze
 
ACTIONS = ( ACCOUNT_ACTIONS + INTEGRATIONS_ACTIONS + MEMBERSHIP_ACTIONS + NOTIFICATIONS_ACTIONS + TEST_ACTIONS ).freeze
 
INTEGRATIONS_ACTIONS = %w[ mailchimp_added mailchimp_failed mailchimp_removed ].freeze
 
MEMBERSHIP_ACTIONS = %w[ auto_upgrade abandoned_conversion charge_created dunning_conversion plan_added plan_changed plan_downgraded plan_expired plan_removed plan_upgraded ].freeze
 
NOTIFICATIONS_ACTIONS = %w[broadcast email should_upgrade].freeze
 
SEVERITY_LEVELS = %i[info warn error].freeze
 
TEST_ACTIONS = %w[_test_event].freeze
 

Attributes

[R] family
[R] reason

Class Public methods

most_recent()

# File app/models/db/event.rb, line 65
def self.most_recent
  order(:created_at).last
end

snooze!()

# File app/models/db/event.rb, line 69
def self.snooze!
  update_all(
    "details = jsonb_set(details, '{snoozed}', to_json(true::boolean)::jsonb)"
  )
end

Instance Public methods

coupon_code()

# File app/models/db/event.rb, line 84
def coupon_code
  details["coupon_code"]
end

reason=(reason)

# File app/models/db/event.rb, line 75
def reason=(reason)
  @reason = get_reason(reason)
  @severity = get_severity(reason)
end

severity()

# File app/models/db/event.rb, line 80
def severity
  @severity ||= :info
end