Sha256: 67d4df1e5cf376dfc0b3f3ac45edb1ac42f7948a8356c38a7f50790bfd8a35a4

Contents?: true

Size: 286 Bytes

Versions: 4

Compression:

Stored size: 286 Bytes

Contents

module Hatchy
  class Announcement < ActiveRecord::Base
    def self.current(hidden_ids=nil)
      result = where("starts_at <= :now and ends_at >= :now", now: Time.zone.now)
      result = result.where("id not in (?)", hidden_ids) if hidden_ids.present?
      result
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hatchy-0.0.8.pre app/models/hatchy/announcement.rb
hatchy-0.0.7.pre app/models/hatchy/announcement.rb
hatchy-0.0.6.pre app/models/hatchy/announcement.rb
hatchy-0.0.5.pre app/models/hatchy/announcement.rb