From 652ecc4707f2e6ee019e1864179ffcaf76706ed2 Mon Sep 17 00:00:00 2001 From: Joe Sak Date: Tue, 15 Feb 2011 23:20:07 -0600 Subject: Closes GH-37. Move habtm assn to a has_many :through so posts can be ordered by published_at DESC on category#show view --- app/models/blog_category.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models/blog_category.rb') diff --git a/app/models/blog_category.rb b/app/models/blog_category.rb index 8ffe834..fbd5465 100644 --- a/app/models/blog_category.rb +++ b/app/models/blog_category.rb @@ -1,6 +1,7 @@ class BlogCategory < ActiveRecord::Base - has_and_belongs_to_many :posts, :class_name => 'BlogPost' + has_many :categorizations + has_many :posts, :through => :categorizations, :source => :blog_post, :order => 'published_at DESC' acts_as_indexed :fields => [:title] -- cgit v1.2.3