module ActiveRegulation::Activation
Public Instance Methods
active!()
click to toggle source
# File lib/active_regulation/activation.rb, line 12 def active! update(inactivated_at: nil) if inactive? end
active?()
click to toggle source
# File lib/active_regulation/activation.rb, line 20 def active? inactivated_at.nil? end
inactivated_at_or_time()
click to toggle source
# File lib/active_regulation/activation.rb, line 28 def inactivated_at_or_time active? ? Time.current : inactivated_at end
inactive!()
click to toggle source
# File lib/active_regulation/activation.rb, line 16 def inactive! update(inactivated_at: Time.current) if active? end
inactive?()
click to toggle source
# File lib/active_regulation/activation.rb, line 24 def inactive? !active? end
to_activation()
click to toggle source
# File lib/active_regulation/activation.rb, line 32 def to_activation I18n.t("active_regulation.activation.#{active? ? :active : :inactive}") end