1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use symbols for send and respond_to?.

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
Clemens Kofler 2008-09-02 10:00:41 +02:00 committed by Jeremy Kemper
parent 2e240f0eac
commit abebdf52a3

View file

@ -246,7 +246,7 @@ module ActionView
alias_method :tag_without_error_wrapping, :tag
def tag(name, options)
if object.respond_to?("errors") && object.errors.respond_to?("on")
if object.respond_to?(:errors) && object.errors.respond_to?(:on)
error_wrapping(tag_without_error_wrapping(name, options), object.errors.on(@method_name))
else
tag_without_error_wrapping(name, options)
@ -255,7 +255,7 @@ module ActionView
alias_method :content_tag_without_error_wrapping, :content_tag
def content_tag(name, value, options)
if object.respond_to?("errors") && object.errors.respond_to?("on")
if object.respond_to?(:errors) && object.errors.respond_to?(:on)
error_wrapping(content_tag_without_error_wrapping(name, value, options), object.errors.on(@method_name))
else
content_tag_without_error_wrapping(name, value, options)
@ -264,7 +264,7 @@ module ActionView
alias_method :to_date_select_tag_without_error_wrapping, :to_date_select_tag
def to_date_select_tag(options = {}, html_options = {})
if object.respond_to?("errors") && object.errors.respond_to?("on")
if object.respond_to?(:errors) && object.errors.respond_to?(:on)
error_wrapping(to_date_select_tag_without_error_wrapping(options, html_options), object.errors.on(@method_name))
else
to_date_select_tag_without_error_wrapping(options, html_options)
@ -273,7 +273,7 @@ module ActionView
alias_method :to_datetime_select_tag_without_error_wrapping, :to_datetime_select_tag
def to_datetime_select_tag(options = {}, html_options = {})
if object.respond_to?("errors") && object.errors.respond_to?("on")
if object.respond_to?(:errors) && object.errors.respond_to?(:on)
error_wrapping(to_datetime_select_tag_without_error_wrapping(options, html_options), object.errors.on(@method_name))
else
to_datetime_select_tag_without_error_wrapping(options, html_options)
@ -282,7 +282,7 @@ module ActionView
alias_method :to_time_select_tag_without_error_wrapping, :to_time_select_tag
def to_time_select_tag(options = {}, html_options = {})
if object.respond_to?("errors") && object.errors.respond_to?("on")
if object.respond_to?(:errors) && object.errors.respond_to?(:on)
error_wrapping(to_time_select_tag_without_error_wrapping(options, html_options), object.errors.on(@method_name))
else
to_time_select_tag_without_error_wrapping(options, html_options)
@ -298,7 +298,7 @@ module ActionView
end
def column_type
object.send("column_for_attribute", @method_name).type
object.send(:column_for_attribute, @method_name).type
end
end
end