summaryrefslogtreecommitdiffstats
path: root/config/initializers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-14 07:55:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-14 07:55:36 +0000
commit9d9e26317a611a393d966e80ec4620304baff67e (patch)
tree9af682048677e87ad223b2ab3dd6d932a7a814e6 /config/initializers
parent9e20edf2d4f178c2eea0e86385e8b2e0f9d140bd (diff)
downloadredmine-9d9e26317a611a393d966e80ec4620304baff67e.tar.gz
redmine-9d9e26317a611a393d966e80ec4620304baff67e.zip
Don't use alias_chain_method.
git-svn-id: http://svn.redmine.org/redmine/trunk@15660 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/10-patches.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index ef8b930ef..671b6df40 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -70,35 +70,35 @@ module ActionView
module Tags
class Base
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
options = options.dup
options[:include_blank] = '&nbsp;'.html_safe
end
add_options_without_non_empty_blank_option(option_tags, options, value)
end
- alias_method_chain :add_options, :non_empty_blank_option
end
end
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)
options[:prompt] = '&nbsp;'.html_safe
end
select_tag_without_non_empty_blank_option(name, option_tags, options)
end
- alias_method_chain :select_tag, :non_empty_blank_option
end
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)
container = container.map {|element| element.blank? ? ["&nbsp;".html_safe, ""] : element}
end
options_for_select_without_non_empty_blank_option(container, selected)
end
- alias_method_chain :options_for_select, :non_empty_blank_option
end
end
end