lib/jbuilder/jbuilder_template.rb in jbuilder-2.2.11 vs lib/jbuilder/jbuilder_template.rb in jbuilder-2.2.12
- old
+ new
@@ -7,13 +7,13 @@
attr_accessor :template_lookup_options
end
self.template_lookup_options = { handlers: [:jbuilder] }
- def initialize(context, *args, &block)
+ def initialize(context, *args)
@context = context
- super(*args, &block)
+ super(*args)
end
def partial!(name_or_options, locals = {})
case name_or_options
when ::Hash
@@ -72,11 +72,11 @@
# Example:
#
# json.cache_if! !admin?, @person, expires_in: 10.minutes do
# json.extract! @person, :name, :age
# end
- def cache_if!(condition, *args, &block)
- condition ? cache!(*args, &block) : yield
+ def cache_if!(condition, *args)
+ condition ? cache!(*args, &::Proc.new) : yield
end
protected
def _render_partial_with_options(options)