app/models/page.rb in tkh_content-0.0.3.1 vs app/models/page.rb in tkh_content-0.1
- old
+ new
@@ -3,14 +3,17 @@
attr_accessible :locale
end
class Page < ActiveRecord::Base
+ belongs_to :author, class_name: 'User', foreign_key: 'author_id'
+
attr_accessible :body, :description, :title, :blog_post, :for_blog
validates_presence_of :title
validates_presence_of :description
validates_presence_of :body
+ validates_presence_of :author_id
translates :title, :description, :body
def to_param
title ? "#{id}-#{title.to_url}" : id