lib/praxis-blueprints/renderer.rb in praxis-blueprints-3.3 vs lib/praxis-blueprints/renderer.rb in praxis-blueprints-3.4
- old
+ new
@@ -45,11 +45,11 @@
object.each_with_index.collect do |sub_object, i|
sub_context = context + ["at(#{i})"]
render(sub_object, sub_fields, view, context: sub_context)
end
elsif object.is_a? Praxis::Blueprint
- @cache[object.object_id][fields.object_id] ||= _render(object, fields, view, context: context)
+ @cache[object._cache_key][fields] ||= _render(object, fields, view, context: context)
else
_render(object, fields, view, context: context)
end
rescue SystemStackError
raise CircularRenderingError.new(object, context)
@@ -74,10 +74,10 @@
ActiveSupport::Notifications.instrument 'praxis.blueprint.render', notification_payload do
fields.each_with_object({}) do |(key, subfields), hash|
begin
value = object._get_attr(key)
rescue => e
- raise Attributor::DumpError, context: context, name: key, type: object.class, original_exception: e
+ raise Attributor::DumpError.new(context: context, name: key, type: object.class, original_exception: e)
end
if value.nil?
hash[key] = nil if self.include_nil
next