Skip to content
This repository was archived by the owner on Sep 24, 2019. It is now read-only.

Commit f99dddd

Browse files
committed
fix splitting
1 parent d7c3d96 commit f99dddd

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

app/models/graph/types/film.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Types
1414
field :director, types.String, "The name of the director of this film."
1515
field :producers, types[types.String] do
1616
description "The name(s) of the producer(s) of this film."
17-
resolve ->(film, _, _) { film.producer.delete(" \t\r\n").split(",") }
17+
resolve ->(film, _, _) { film.producer.split(", ") }
1818
end
1919

2020
field :releaseDate, types.String,

app/models/graph/types/species.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module Types
2626
return unless colors = species.eye_colors
2727
return if species.eye_colors.include?("none")
2828

29-
colors.delete(" \t\r\n").split(",")
29+
colors.split(", ")
3030
end
3131
end
3232

@@ -36,7 +36,7 @@ module Types
3636
return unless colors = species.hair_colors
3737
return if species.hair_colors.include?("none")
3838

39-
colors.delete(" \t\r\n").split(",")
39+
colors.split(", ")
4040
end
4141
end
4242

@@ -46,7 +46,7 @@ module Types
4646
return unless colors = species.skin_colors
4747
return if species.skin_colors.include?("none")
4848

49-
colors.delete(" \t\r\n").split(",")
49+
colors.split(", ")
5050
end
5151
end
5252

test/controllers/graphql_controller_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class GraphQLControllerTest < ActionDispatch::IntegrationTest
2222
"director" => "George Lucas",
2323
"episodeID" => 4,
2424
"id" => "846649883",
25-
"producers" => ["GaryKurtz", "RickMcCallum"],
25+
"producers" => ["Gary Kurtz", "Rick McCallum"],
2626
"releaseDate" => "1977-05-25",
2727
"title" => "A New Hope"
2828
},

0 commit comments

Comments
 (0)