Skip to content

Commit

Permalink
fix disqus comments and blog config
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus committed May 8, 2012
1 parent 8b324f8 commit a11a8e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/spree/blogs/posts/show.html.erb
Expand Up @@ -32,6 +32,6 @@
</div>
<% end %>
<%= render "spree/blogs/shared/disqus_comments" if @blog_config %>
<%= render "spree/blogs/shared/disqus_comments" %>

</div>
2 changes: 1 addition & 1 deletion app/views/spree/blogs/shared/_disqus_comments.html.erb
@@ -1,4 +1,4 @@
<% disqus_short_name = SpreeEssentialBlog::Config.preferred_disqus_shortname %>
<% disqus_short_name = ::SpreeEssentialBlog::Config.preferred_disqus_shortname %>
<% if !disqus_short_name.blank? %>
<div class="post-comments">
<h3><%= t('spree.blogs.comments') %></h3>
Expand Down
5 changes: 3 additions & 2 deletions lib/spree_essential_blog/engine.rb
Expand Up @@ -6,8 +6,9 @@ class Engine < Rails::Engine
config.autoload_paths += %W(#{config.root}/lib)

config.to_prepare do

SpreeEssentialBlog::Config = Spree::BlogConfiguration.new unless SpreeEssentialBlog.const_defined?(:Config)

# Would be nice to use const_defined?(:Config, false) here but it's not 1.8.x compatible
::SpreeEssentialBlog::Config = Spree::BlogConfiguration.new unless SpreeEssentialBlog.constants.include?(:Config)

Dir.glob File.expand_path("../../../app/**/*_decorator.rb", __FILE__) do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
Expand Down

0 comments on commit a11a8e3

Please sign in to comment.