app/cms/scrivito/test_request.rb in scrivito_sdk-1.15.0 vs app/cms/scrivito/test_request.rb in scrivito_sdk-1.16.0.rc1
- old
+ new
@@ -27,23 +27,21 @@
# end
#
def for_scrivito_obj(test_obj = nil, routes = nil)
env[Scrivito::CmsEnv::OBJ_ENV_KEY] = test_obj if test_obj
- unless Scrivito::LegacySwitch.rails4?
- # If +assign_parameters+ is monkey patched, then +generate_extras+ also needs to
- # be monkey patched. See [1] for details.
- #
- # [1] https://github.com/rails/rails/commit/f6232a518bb7377948f339d2b0b25dc607e1e42a
- class << (routes || Rails.application.routes)
- def generate_extras(options, recall={})
- super options, recall
- rescue *ROUTING_ERRORS => e
- begin
- super options.merge(controller: 'scrivito/cms_dispatch'), recall
- rescue *ROUTING_ERRORS
- raise e
- end
+ # If +assign_parameters+ is monkey patched, then +generate_extras+ also needs to
+ # be monkey patched. See [1] for details.
+ #
+ # [1] https://github.com/rails/rails/commit/f6232a518bb7377948f339d2b0b25dc607e1e42a
+ class << (routes || Rails.application.routes)
+ def generate_extras(options, recall={})
+ super options, recall
+ rescue *ROUTING_ERRORS => e
+ begin
+ super options.merge(controller: 'scrivito/cms_dispatch'), recall
+ rescue *ROUTING_ERRORS
+ raise e
end
end
end
def self.assign_parameters(routes, controller_path, *args)