Remove unused dup. Let inject split hash for us

This commit is contained in:
ccocchi 2012-10-22 18:05:22 +01:00
parent 24ce3a1d7c
commit 286f08eb83
2 changed files with 1 additions and 3 deletions

View File

@ -21,7 +21,6 @@ module RablRails
def compile_template_from_source(source, path = nil) def compile_template_from_source(source, path = nil)
if path && RablRails.cache_templates? if path && RablRails.cache_templates?
@cached_templates[path] ||= Compiler.new.compile_source(source) @cached_templates[path] ||= Compiler.new.compile_source(source)
@cached_templates[path].dup
else else
Compiler.new.compile_source(source) Compiler.new.compile_source(source)
end end

View File

@ -48,8 +48,7 @@ module RablRails
# template source passed. # template source passed.
# #
def render_resource(data, source) def render_resource(data, source)
source.inject({}) { |output, current| source.inject({}) { |output, (key, value)|
key, value = current
out = case value out = case value
when Symbol when Symbol