Skip to content

Commit

Permalink
Use preview to find site-config as well
Browse files Browse the repository at this point in the history
  • Loading branch information
gburgett committed Jan 31, 2019
1 parent 785914b commit f546889
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -46,6 +46,6 @@ def global_site_config
# They may have not installed `site-config` in the project
return unless defined?(WCC::Contentful::Model::SiteConfig)

@global_site_config ||= WCC::Contentful::Model::SiteConfig.instance
@global_site_config ||= WCC::Contentful::Model::SiteConfig.instance(preview?)
end
end
4 changes: 2 additions & 2 deletions wcc-contentful-app/lib/wcc/contentful/model/site_config.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class WCC::Contentful::Model::SiteConfig < WCC::Contentful::Model
def self.instance
find_by(foreign_key: 'default', options: { include: 4 })
def self.instance(preview = false)
find_by(foreign_key: 'default', options: { include: 4, preview: preview })
end
end

0 comments on commit f546889

Please sign in to comment.