From 0667904262163860169cab5fb68f39446ed7e656 Mon Sep 17 00:00:00 2001 From: Alexander Kledal <201371052@iha.dk> Date: Thu, 18 Aug 2016 12:28:15 +0200 Subject: [PATCH] Update populator.md Be consistent with to_i / to_s when we use find on fragment. --- gems/reform/populator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gems/reform/populator.md b/gems/reform/populator.md index b14b35d9..92154d48 100644 --- a/gems/reform/populator.md +++ b/gems/reform/populator.md @@ -235,7 +235,7 @@ You can use `:populator` to write your own matching for IDs. collection :songs, populator: ->(fragment:, **) { # find out if incoming song is already added. - item = songs.find { |song| song.id == fragment["id"].to_i } + item = songs.find { |song| song.id.to_s == fragment["id"].to_s } item ? item : songs.append(Song.new) }