Closes #355, but using deep_dup, which is only available in Rails 3.1

This commit is contained in:
George Guimarães 2011-11-29 18:37:58 -02:00
parent cba2b49410
commit 660b98655a
1 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,5 @@
require 'active_support/core_ext/hash/deep_dup'
module SimpleForm
class FormBuilder < ActionView::Helpers::FormBuilder
attr_reader :template, :object_name, :object, :wrapper
@ -98,7 +100,7 @@ module SimpleForm
# given SimpleForm.time_zone_priority and SimpleForm.country_priority are used respectivelly.
#
def input(attribute_name, options={}, &block)
options = @defaults.deep_merge(options) if @defaults
options = @defaults.deep_dup.deep_merge(options) if @defaults
chosen =
if name = options[:wrapper]