diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/refinery/blog/categorization.rb | 12 | ||||
-rw-r--r-- | app/models/refinery/blog/post.rb | 2 | ||||
-rw-r--r-- | app/models/refinery/categorization.rb | 10 |
3 files changed, 13 insertions, 11 deletions
diff --git a/app/models/refinery/blog/categorization.rb b/app/models/refinery/blog/categorization.rb new file mode 100644 index 0000000..7ca9c77 --- /dev/null +++ b/app/models/refinery/blog/categorization.rb @@ -0,0 +1,12 @@ +module Refinery + module Blog + class Categorization < ActiveRecord::Base + + self.table_name = 'refinery_blog_categories_blog_posts' + belongs_to :blog_post, :class_name => 'Refinery::Blog::Post', :foreign_key => :blog_post_id + belongs_to :blog_category, :class_name => 'Refinery::Blog::Category', :foreign_key => :blog_category_id + + attr_accessible :blog_category_id, :blog_post_id + end + end +end diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb index 49d77c9..28d14e5 100644 --- a/app/models/refinery/blog/post.rb +++ b/app/models/refinery/blog/post.rb @@ -122,7 +122,7 @@ module Refinery end def uncategorized - live.includes(:categories).where(Refinery::Categorization.table_name => { :blog_category_id => nil }) + live.includes(:categories).where(Refinery::Blog::Categorization.table_name => { :blog_category_id => nil }) end def next(current_record) diff --git a/app/models/refinery/categorization.rb b/app/models/refinery/categorization.rb deleted file mode 100644 index 688da6a..0000000 --- a/app/models/refinery/categorization.rb +++ /dev/null @@ -1,10 +0,0 @@ -module Refinery - class Categorization < ActiveRecord::Base - - self.table_name = 'refinery_blog_categories_blog_posts' - belongs_to :blog_post, :class_name => 'Refinery::Blog::Post', :foreign_key => :blog_post_id - belongs_to :blog_category, :class_name => 'Refinery::Blog::Category', :foreign_key => :blog_category_id - - attr_accessible :blog_category_id, :blog_post_id - end -end |