Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix exceptions when call translated class method. #505

Open
wants to merge 1 commit into
base: feature/refinery-5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/refinery/blog/blog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions app/models/refinery/blog/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Blog
class Category < ActiveRecord::Base
extend Mobility
translates :title, :slug

extend FriendlyId
friendly_id :title, :use => [:mobility, :slugged]

Expand All @@ -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
Expand Down