Permalink
Browse files

Allow model to be inherited from Hash [#6487 state:resolved]

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
  • Loading branch information...
wildchild authored and pixeltrix committed Mar 6, 2011
1 parent dff73de commit 0509bf35f1987c1e0b9c3dd1389778f8426180f7
Showing with 4 additions and 3 deletions.
  1. +4 −3 actionpack/lib/action_view/helpers/form_helper.rb
@@ -6,6 +6,7 @@
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 @@ def range_field(object_name, method, options = {})
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

0 comments on commit 0509bf3

Please sign in to comment.