lib/wcc/contentful/store.rb in wcc-contentful-0.2.1 vs lib/wcc/contentful/store.rb in wcc-contentful-0.2.2

- old
+ new

@@ -54,11 +54,15 @@ config.client, cache: ActiveSupport::Cache.lookup_store(*options) ) end - def build_direct(config, *_options) - CDNAdapter.new(config.client) + def build_direct(config, *options) + if options.find { |array| array[:preview] == true } + CDNAdapter.new(config.preview_client) + else + CDNAdapter.new(config.client) + end end def validate_eager_sync(_config, store = nil, *_options) return unless store.is_a?(Symbol)