lib/scrivito/binary_routing.rb in scrivito_sdk-1.8.1 vs lib/scrivito/binary_routing.rb in scrivito_sdk-1.9.0.rc1
- old
+ new
@@ -7,17 +7,17 @@
def binary_obj_url(obj, binary, image_options = {})
binary = if image_options.key?(:transform)
apply_custom_transformation(binary, image_options[:transform])
else
- apply_default_transformation(binary, obj)
+ apply_default_transformation(binary)
end
binary_url(binary)
end
def resolved_binary_obj_url(obj, binary)
- apply_default_transformation(binary, obj).url
+ BinaryRewrite.call(request, apply_default_transformation(binary).url)
end
private
def binary_url_from_cache(binary)
@@ -37,13 +37,12 @@
else
binary
end
end
- def apply_default_transformation(binary, obj)
- if (transformation_definition = Scrivito::Configuration.default_image_transformation) &&
- obj.apply_image_transformation?
- binary.transform(transformation_definition)
+ def apply_default_transformation(binary)
+ if Scrivito::Configuration.default_image_transformation
+ binary.transform(Scrivito::Configuration.default_image_transformation)
else
binary
end
end
end