提交 70f7ba3e 编写于 作者: J José Valim

There is absolutely no need to use __send__ here.

上级 ab6ff859
...@@ -110,7 +110,7 @@ def polymorphic_url(record_or_hash_or_array, options = {}) ...@@ -110,7 +110,7 @@ def polymorphic_url(record_or_hash_or_array, options = {})
args.last.kind_of?(Hash) ? args.last.merge!(url_options) : args << url_options args.last.kind_of?(Hash) ? args.last.merge!(url_options) : args << url_options
end end
__send__(named_route, *args) send(named_route, *args)
end end
# Returns the path component of a URL for the given record. It uses # Returns the path component of a URL for the given record. It uses
...@@ -154,7 +154,7 @@ def build_named_route_call(records, inflection, options = {}) ...@@ -154,7 +154,7 @@ def build_named_route_call(records, inflection, options = {})
if parent.is_a?(Symbol) || parent.is_a?(String) if parent.is_a?(Symbol) || parent.is_a?(String)
string << "#{parent}_" string << "#{parent}_"
else else
string << RecordIdentifier.__send__("plural_class_name", parent).singularize string << RecordIdentifier.plural_class_name(parent).singularize
string << "_" string << "_"
end end
end end
...@@ -163,7 +163,7 @@ def build_named_route_call(records, inflection, options = {}) ...@@ -163,7 +163,7 @@ def build_named_route_call(records, inflection, options = {})
if record.is_a?(Symbol) || record.is_a?(String) if record.is_a?(Symbol) || record.is_a?(String)
route << "#{record}_" route << "#{record}_"
else else
route << RecordIdentifier.__send__("plural_class_name", record) route << RecordIdentifier.plural_class_name(record)
route = route.singularize if inflection == :singular route = route.singularize if inflection == :singular
route << "_" route << "_"
route << "index_" if RecordIdentifier.uncountable?(record) && inflection == :plural route << "index_" if RecordIdentifier.uncountable?(record) && inflection == :plural
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册