Sha256: cbf6346759ad39106063fa21ca7f8514cffd02338c42a3368c5ffde42aad98ae

Contents?: true

Size: 179 Bytes

Versions: 23

Compression:

Stored size: 179 Bytes

Contents

module WithTimedEnablement
  extend ActiveSupport::Concern

  def enabled?
    enabled_range.cover? DateTime.current
  end

  def enabled_range
    start_time..end_time
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
mumuki-domain-9.8.1 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.8.0 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.7.0 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.6.0 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.5.0 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.4.0 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.3.0 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.2.1 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.2.0 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.1.2 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.1.1 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.1.0 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.0.6 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.0.5 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.0.4 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.0.3 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.0.2 app/models/concerns/with_timed_enablement.rb
mumuki-domain-9.0.0 app/models/concerns/with_timed_enablement.rb
mumuki-domain-8.6.1 app/models/concerns/with_timed_enablement.rb
mumuki-domain-8.6.0 app/models/concerns/with_timed_enablement.rb