Sha256: d48c7789049852f412a2d82c94ad5fa73b593fbeee3f1272e70cec20907004d0

Contents?: true

Size: 418 Bytes

Versions: 6

Compression:

Stored size: 418 Bytes

Contents

module Ants
  module Scheduled
    extend ActiveSupport::Concern
    included do
      ## Attributes
      field :published_at, type: DateTime

      ## Scopes
      default_scope -> { desc(:published_at) }
      scope :scheduled, -> { where(:published_at.gt => Time.zone.now) }
      scope :published, -> { where( :published_at.lte => Time.zone.now) }

      ## Indexes
      index published_at: -1
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ants-0.3.14 lib/concerns/ants/scheduled.rb
ants-0.3.13 lib/concerns/ants/scheduled.rb
ants-0.3.12 lib/concerns/ants/scheduled.rb
ants-0.3.11 lib/concerns/ants/scheduled.rb
ants-0.3.10 lib/concerns/ants/scheduled.rb
ants-0.3.9 lib/concerns/ants/scheduled.rb