Skip to content

Commit

Permalink
rename instantiate_builder method to avoid collision with Rails' of…
Browse files Browse the repository at this point in the history
… the same method name

closes #694
  • Loading branch information
nashby committed Nov 28, 2012
1 parent c931e68 commit dde05d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/simple_form/action_view_extensions/builder.rb
Expand Up @@ -92,7 +92,7 @@ def collection_radio_buttons(attribute, collection, value_method, text_method, o
rendered_collection = render_collection(
collection, value_method, text_method, options, html_options
) do |item, value, text, default_html_options|
builder = instantiate_builder(RadioButtonBuilder, attribute, item, value, text, default_html_options)
builder = instantiate_collection_builder(RadioButtonBuilder, attribute, item, value, text, default_html_options)

if block_given?
yield builder
Expand Down Expand Up @@ -167,7 +167,7 @@ def collection_check_boxes(attribute, collection, value_method, text_method, opt
collection, value_method, text_method, options, html_options
) do |item, value, text, default_html_options|
default_html_options[:multiple] = true
builder = instantiate_builder(CheckBoxBuilder, attribute, item, value, text, default_html_options)
builder = instantiate_collection_builder(CheckBoxBuilder, attribute, item, value, text, default_html_options)

if block_given?
yield builder
Expand Down Expand Up @@ -207,7 +207,7 @@ def simple_fields_for(*args, &block)

private

def instantiate_builder(builder_class, attribute, item, value, text, html_options)
def instantiate_collection_builder(builder_class, attribute, item, value, text, html_options)
builder_class.new(self, attribute, item,
sanitize_attribute_name(attribute, value), text, value, html_options)
end
Expand Down

1 comment on commit dde05d2

@carlosantoniodasilva
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💖

Please sign in to comment.