Skip to content

Commit

Permalink
Ensure Ruby server doesn't have duplicate id fields in json
Browse files Browse the repository at this point in the history
Alternative approach to reactjs#115
  • Loading branch information
zpao committed Jan 24, 2016
1 parent 6e6ff3a commit e50157d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Assume it's well formed
comment = { id: (Time.now.to_f * 1000).to_i }
req.query.each do |key, value|
comment[key] = value.force_encoding('UTF-8')
comment[key] = value.force_encoding('UTF-8') unless key == 'id'
end
comments << comment
File.write(
Expand Down

0 comments on commit e50157d

Please sign in to comment.