Sha256: 074149ad47f3358b5110d6cd0b789db8da61119e977710549977c180689e4c5e

Contents?: true

Size: 232 Bytes

Versions: 7

Compression:

Stored size: 232 Bytes

Contents

class Announcement < ActiveRecord::Base
  def self.current
    order("created_at desc").first || new
  end

  def exists?
    !new_record?
  end

  def to_cookie_key
    "#{self.class.name.downcase}_#{created_at.iso8601}"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
paul_revere-3.3.0 app/models/announcement.rb
paul_revere-3.2.0 app/models/announcement.rb
paul_revere-3.1.0 app/models/announcement.rb
paul_revere-3.0.0 app/models/announcement.rb
paul_revere-2.1.0 app/models/announcement.rb
paul_revere-2.1.0.rc1 app/models/announcement.rb
paul_revere-2.0.0 app/models/announcement.rb