aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorAlexander Uvarov <alexander.uvarov@gmail.com>2011-03-06 09:00:22 +0500
committerAndrew White <andyw@pixeltrix.co.uk>2011-03-06 05:28:35 +0000
commit0509bf35f1987c1e0b9c3dd1389778f8426180f7 (patch)
treea1ae57eed525e2be60a11aaded9f363b07d4c350 /actionpack/lib
parentdff73dec223c5d4ffe1178e0e15399f78d962e76 (diff)
downloadrails-0509bf35f1987c1e0b9c3dd1389778f8426180f7.tar.gz
rails-0509bf35f1987c1e0b9c3dd1389778f8426180f7.tar.bz2
rails-0509bf35f1987c1e0b9c3dd1389778f8426180f7.zip
Allow model to be inherited from Hash [#6487 state:resolved]
Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 669ccd2a2d..6df86ae65a 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -6,6 +6,7 @@ require 'active_support/core_ext/class/attribute'
require 'active_support/core_ext/hash/slice'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/string/output_safety'
+require 'active_support/core_ext/array/extract_options'
module ActionView
# = Action View Form Helpers
@@ -880,9 +881,9 @@ module ActionView
private
- def instantiate_builder(record, record_object = nil, options = nil, &block)
- options, record_object = record_object, nil if record_object.is_a?(Hash)
- options ||= {}
+ def instantiate_builder(record, *args, &block)
+ options = args.extract_options!
+ record_object = args.shift
case record
when String, Symbol