lib/scrivito/sdk_engine.rb in scrivito_sdk-0.41.1 vs lib/scrivito/sdk_engine.rb in scrivito_sdk-0.42.0
- old
+ new
@@ -4,10 +4,16 @@
require 'jquery-rails'
require 'net/http/post/multipart'
module ::Scrivito
class SdkEngine < Rails::Engine
- config.to_prepare { Scrivito::Configuration.to_prepare }
+ config.to_prepare do
+ Scrivito::Configuration.to_prepare
+
+ unless Rails.application.config.cache_classes
+ Scrivito.models.clear_cache
+ end
+ end
# make sure our exceptions cause an adequate error page and http status code
config.action_dispatch.rescue_responses.merge!("Scrivito::ResourceNotFound" => :not_found)
initializer "scrivito.add_cms_routing_paths", :after => :add_routing_paths do |app|