From bbb6e3e61eda9a8aea30b0568b565b73c3d97a3b Mon Sep 17 00:00:00 2001 From: lanzhiheng Date: Fri, 18 Jan 2019 12:51:33 +0800 Subject: [PATCH] fix: Fix exceptions when call `translated` class method. --- app/controllers/refinery/blog/blog_controller.rb | 2 +- app/models/refinery/blog/category.rb | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/controllers/refinery/blog/blog_controller.rb b/app/controllers/refinery/blog/blog_controller.rb index 83d63fc6..2e4dda30 100644 --- a/app/controllers/refinery/blog/blog_controller.rb +++ b/app/controllers/refinery/blog/blog_controller.rb @@ -8,7 +8,7 @@ class BlogController < ::ApplicationController protected def find_all_blog_categories - @categories = Refinery::Blog::Category.translated + @categories = Refinery::Blog::Category.all end def find_blog_post diff --git a/app/models/refinery/blog/category.rb b/app/models/refinery/blog/category.rb index b6335196..7a79c873 100644 --- a/app/models/refinery/blog/category.rb +++ b/app/models/refinery/blog/category.rb @@ -3,7 +3,7 @@ module Blog class Category < ActiveRecord::Base extend Mobility translates :title, :slug - + extend FriendlyId friendly_id :title, :use => [:mobility, :slugged] @@ -16,10 +16,6 @@ def self.by_title(title) joins(:translations).find_by(title: title) end - def self.translated - translations.in_locale(Mobility.locale) - end - def post_count posts.live.with_mobility.count end