lib/jbuilder/jbuilder_template.rb in jbuilder-2.2.2 vs lib/jbuilder/jbuilder_template.rb in jbuilder-2.2.3
- old
+ new
@@ -28,11 +28,11 @@
end
_render_partial_with_options options
end
- def array!(collection = [], *attributes, &block)
+ def array!(collection = [], *attributes)
options = attributes.extract_options!
if options.key?(:partial)
partial! options[:partial], options.merge(collection: collection)
else
@@ -46,11 +46,11 @@
# Example:
#
# json.cache! ['v1', @person], expires_in: 10.minutes do
# json.extract! @person, :name, :age
# end
- def cache!(key=nil, options={}, &block)
+ def cache!(key=nil, options={})
if @context.controller.perform_caching
value = ::Rails.cache.fetch(_cache_key(key, options), options) do
_scope { yield self }
end
@@ -135,7 +135,5 @@
# this juggling is required to keep line numbers right in the error
%{__already_defined = defined?(json); json||=JbuilderTemplate.new(self); #{template.source}
json.target! unless (__already_defined && __already_defined != "method")}
end
end
-
-ActionView::Template.register_template_handler :jbuilder, JbuilderHandler