module Lite::Regulation::Activation

Public Instance Methods

active!() click to toggle source
# File lib/lite/regulation/activation.rb, line 14
def active!
  return true if active?

  update(inactivated_at: nil)
end
active?() click to toggle source
# File lib/lite/regulation/activation.rb, line 20
def active?
  inactivated_at.nil?
end
inactivated_at_or_time() click to toggle source
# File lib/lite/regulation/activation.rb, line 34
def inactivated_at_or_time
  return inactivated_at if inactive?

  Lite::Regulation::Base.timestamp
end
inactive!() click to toggle source
# File lib/lite/regulation/activation.rb, line 24
def inactive!
  return true if inactive?

  update(inactivated_at: Time.current)
end
inactive?() click to toggle source
# File lib/lite/regulation/activation.rb, line 30
def inactive?
  !active?
end
to_activation() click to toggle source
# File lib/lite/regulation/activation.rb, line 40
def to_activation
  I18n.t("lite.regulation.activation.#{:in if inactive?}active")
end