Sha256: 9b0771cde2e33725e237d5af9c9c317e94ddc421e0b8744df15da90aa0b62c28
Contents?: true
Size: 1.03 KB
Versions: 6
Compression:
Stored size: 1.03 KB
Contents
module Gluttonberg module Admin class MainController < Gluttonberg::Admin::BaseController unloadable def index @categories_count = ActsAsTaggableOn::Tag.find_by_sql(%{ select count(DISTINCT tags.id) as category_count from tags inner join taggings on tags.id = taggings.tag_id where context = 'article_category' }).first.category_count @tags_counts = ActsAsTaggableOn::Tag.count - @categories_count.to_i if Blog.table_exists? @blog = Blog.first end if Comment.table_exists? @comments = Comment.find(:all , :conditions => {:commentable_type => "Gluttonberg::Article" , :moderation_required => true } , :order => "created_at DESC" , :limit => 3) @article = Article.new @article_localization = ArticleLocalization.new(:article => @article , :locale_id => Locale.first_default.id) @blogs = Gluttonberg::Blog.all @authors = User.all end end def show end end end end
Version data entries
6 entries across 6 versions & 1 rubygems