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:
parent
2e240f0eac
commit
abebdf52a3
1 changed files with 6 additions and 6 deletions
|
@ -246,7 +246,7 @@ module ActionView
|
||||||
|
|
||||||
alias_method :tag_without_error_wrapping, :tag
|
alias_method :tag_without_error_wrapping, :tag
|
||||||
def tag(name, options)
|
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))
|
error_wrapping(tag_without_error_wrapping(name, options), object.errors.on(@method_name))
|
||||||
else
|
else
|
||||||
tag_without_error_wrapping(name, options)
|
tag_without_error_wrapping(name, options)
|
||||||
|
@ -255,7 +255,7 @@ module ActionView
|
||||||
|
|
||||||
alias_method :content_tag_without_error_wrapping, :content_tag
|
alias_method :content_tag_without_error_wrapping, :content_tag
|
||||||
def content_tag(name, value, options)
|
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))
|
error_wrapping(content_tag_without_error_wrapping(name, value, options), object.errors.on(@method_name))
|
||||||
else
|
else
|
||||||
content_tag_without_error_wrapping(name, value, options)
|
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
|
alias_method :to_date_select_tag_without_error_wrapping, :to_date_select_tag
|
||||||
def to_date_select_tag(options = {}, html_options = {})
|
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))
|
error_wrapping(to_date_select_tag_without_error_wrapping(options, html_options), object.errors.on(@method_name))
|
||||||
else
|
else
|
||||||
to_date_select_tag_without_error_wrapping(options, html_options)
|
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
|
alias_method :to_datetime_select_tag_without_error_wrapping, :to_datetime_select_tag
|
||||||
def to_datetime_select_tag(options = {}, html_options = {})
|
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))
|
error_wrapping(to_datetime_select_tag_without_error_wrapping(options, html_options), object.errors.on(@method_name))
|
||||||
else
|
else
|
||||||
to_datetime_select_tag_without_error_wrapping(options, html_options)
|
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
|
alias_method :to_time_select_tag_without_error_wrapping, :to_time_select_tag
|
||||||
def to_time_select_tag(options = {}, html_options = {})
|
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))
|
error_wrapping(to_time_select_tag_without_error_wrapping(options, html_options), object.errors.on(@method_name))
|
||||||
else
|
else
|
||||||
to_time_select_tag_without_error_wrapping(options, html_options)
|
to_time_select_tag_without_error_wrapping(options, html_options)
|
||||||
|
@ -298,7 +298,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
|
|
||||||
def column_type
|
def column_type
|
||||||
object.send("column_for_attribute", @method_name).type
|
object.send(:column_for_attribute, @method_name).type
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue