
module JamRuby
  class News < ActiveRecord::Base

    self.table_name = 'news'

    attr_accessible :title, :body, :position, as: :admin
    default_scope { order('position') }
    validates :title, presence: true
    validates :body, presence: true
    validates :position, presence: true, numericality: {only_integer: true}, uniqueness: true

  end
end
