Sha256: 0ab10c4c6c96565c47767d6971d2a5c5d697fadbebf9352faa4002d262a05403

Contents?: true

Size: 412 Bytes

Versions: 5

Compression:

Stored size: 412 Bytes

Contents

class NewsPost < ActiveRecord::Base
  attr_accessible :title, :body
  scope :published, where(:draft => false)
  default_scope order('news_posts.id DESC')
  belongs_to :user
  belongs_to :required_role, :class_name => 'Role', :foreign_key => 'required_role_id', :validate => true

  validates_presence_of :title, :body, :user_id
  validates_associated :user

  acts_as_list

  def self.per_page
    10
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
enju_news-0.1.0.pre2 app/models/news_post.rb
enju_news-0.1.0.pre app/models/news_post.rb
enju_news-0.0.5 app/models/news_post.rb
enju_news-0.0.4 app/models/news_post.rb
enju_news-0.0.3 app/models/news_post.rb