Convert unless/else into if/else.

This commit is contained in:
thedarkone
2010-09-27 17:44:11 +02:00
parent b127e0cac9
commit bb47927d91

View File

@@ -168,10 +168,7 @@ module ActionDispatch
end
def build_named_route_call(records, inflection, options = {})
unless records.is_a?(Array)
record = extract_record(records)
route = []
else
if records.is_a?(Array)
record = records.pop
route = records.map do |parent|
if parent.is_a?(Symbol) || parent.is_a?(String)
@@ -180,6 +177,9 @@ module ActionDispatch
ActiveModel::Naming.route_key(parent).singularize
end
end
else
record = extract_record(records)
route = []
end
if record.is_a?(Symbol) || record.is_a?(String)