Sha256: 3179c0d1ca92161d19878db1a9e0e9e92b34c3ff719ffe0ccca6793c639bef22

Contents?: true

Size: 214 Bytes

Versions: 2

Compression:

Stored size: 214 Bytes

Contents

class Announcement < ActiveRecord::Base
  if Rails::VERSION::MAJOR < 4
    attr_accessible(:body)
  end

  def self.current
    order('created_at desc').first || new
  end

  def exists?
    !new_record?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
paul_revere-1.3 app/models/announcement.rb
paul_revere-1.2 app/models/announcement.rb