aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJoe Sak <joe@joesak.com>2011-02-24 20:46:20 -0600
committerJoe Sak <joe@joesak.com>2011-02-24 20:46:20 -0600
commitc75cf8a00e916e795a0299a55e933c8b3cad17ac (patch)
treec13342d89988d6086558b21049401af0a6f466a5 /app
parent56df60d80a7f5d3a26dbf25689fb118eeacca24d (diff)
downloadrefinerycms-blog-c75cf8a00e916e795a0299a55e933c8b3cad17ac.tar.gz
refinerycms-blog-c75cf8a00e916e795a0299a55e933c8b3cad17ac.tar.bz2
refinerycms-blog-c75cf8a00e916e795a0299a55e933c8b3cad17ac.zip
Blog Posts belong to an author ("user_id")
Diffstat (limited to 'app')
-rw-r--r--app/models/blog_post.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/blog_post.rb b/app/models/blog_post.rb
index 679a21c..0dd1246 100644
--- a/app/models/blog_post.rb
+++ b/app/models/blog_post.rb
@@ -2,6 +2,8 @@ class BlogPost < ActiveRecord::Base
default_scope :order => 'published_at DESC'
+ belongs_to :author, :foreign_key => 'user_id'
+
has_many :comments, :class_name => 'BlogComment', :dependent => :destroy
has_many :categorizations