mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Convert unless/else into if/else.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user