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 n plus one issue and remove some useless code. #503

Open
wants to merge 1 commit into
base: master
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
6 changes: 1 addition & 5 deletions app/models/refinery/blog/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ def validating_source_urls?
verify: [:resolve_redirects]
}

class Translation
is_seo_meta
end

# Override this to disable required authors
def author_required?
!Refinery::Blog.user_class.nil?
Expand Down Expand Up @@ -104,7 +100,7 @@ def with_globalize(conditions = {})
end
end
# A join implies readonly which we don't really want.
where(conditions).joins(:translations).where(globalized_conditions)
where(conditions).includes(:translations).where(globalized_conditions)
.readonly(false)
end

Expand Down
2 changes: 1 addition & 1 deletion refinerycms-blog.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |s|
s.add_dependency 'seo_meta', ['>=3.0.0', '~>3.0']
s.add_dependency 'rails_autolink', '~> 1.1.3'
s.add_dependency 'friendly_id', ['< 5.3', '>= 5.1.0']
s.add_dependency 'globalize', '~> 5.1.0'
s.add_dependency 'globalize', '~> 5.2.0'
s.add_dependency 'activemodel-serializers-xml', '~> 1.0', '>= 1.0.1'
s.add_dependency 'responders', '~> 2.0'
end