Commit 660d611d authored by jplang's avatar jplang

Don't use alias_chain_method.

git-svn-id: e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 453000b3
...@@ -70,35 +70,35 @@ module ActionView ...@@ -70,35 +70,35 @@ module ActionView
module Tags module Tags
class Base class Base
private private
def add_options_with_non_empty_blank_option(option_tags, options, value = nil) alias :add_options_without_non_empty_blank_option :add_options
def add_options(option_tags, options, value = nil)
if options[:include_blank] == true if options[:include_blank] == true
options = options.dup options = options.dup
options[:include_blank] = ' '.html_safe options[:include_blank] = ' '.html_safe
end end
add_options_without_non_empty_blank_option(option_tags, options, value) add_options_without_non_empty_blank_option(option_tags, options, value)
end end
alias_method_chain :add_options, :non_empty_blank_option
end end
end end
module FormTagHelper module FormTagHelper
def select_tag_with_non_empty_blank_option(name, option_tags = nil, options = {}) alias :select_tag_without_non_empty_blank_option :select_tag
def select_tag(name, option_tags = nil, options = {})
if options.delete(:include_blank) if options.delete(:include_blank)
options[:prompt] = ' '.html_safe options[:prompt] = ' '.html_safe
end end
select_tag_without_non_empty_blank_option(name, option_tags, options) select_tag_without_non_empty_blank_option(name, option_tags, options)
end end
alias_method_chain :select_tag, :non_empty_blank_option
end end
module FormOptionsHelper module FormOptionsHelper
def options_for_select_with_non_empty_blank_option(container, selected = nil) alias :options_for_select_without_non_empty_blank_option :options_for_select
def options_for_select(container, selected = nil)
if container.is_a?(Array) if container.is_a?(Array)
container = {|element| element.blank? ? [" ".html_safe, ""] : element} container = {|element| element.blank? ? [" ".html_safe, ""] : element}
end end
options_for_select_without_non_empty_blank_option(container, selected) options_for_select_without_non_empty_blank_option(container, selected)
end end
alias_method_chain :options_for_select, :non_empty_blank_option
end end
end end
end end
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment