Permalink
Browse files

Clone key formatted only when it's needed

  • Loading branch information...
1 parent 0de0e39 commit f1c60f579916cf1a96384a9f01da99865ef8ae80 @rwz rwz committed Sep 15, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/jbuilder.rb
View
@@ -62,7 +62,7 @@ def initialize(*args, &block)
@attributes = ::ActiveSupport::OrderedHash.new
options = args.extract_options!
- @key_formatter = options.fetch(:key_formatter, @@key_formatter.clone)
+ @key_formatter = options.fetch(:key_formatter){ @@key_formatter.clone }
@ignore_nil = options.fetch(:ignore_nil, @@ignore_nil)
yield self if block
end

0 comments on commit f1c60f5

Please sign in to comment.