5 ms·
could you have added some text at the end of the id before sending it and then removed the extra bits from the end on recieving side? something like a parity va
by Achshar 15y ago
could you have added some text at the end of the id before sending it and then removed the extra bits from the end on recieving side? something like a parity value.
- davidcuddeback 15y agoOr just call String#to_s on the Rails side.
- DougBTX 15y agoThat would probably work, but it means that the problem + workaround is spread out across two systems rather than being contained in just one. Also, working around it on the consumer side means that any new consumers (or any new string fields!) will need to use the workaround too, further spreading out the problem. Better to keep it encapsulated in one system if possible.
- tlianza 15y agoIf you have a method that breaks when an int is passed in, just seems like good defensive programming to call to_s in Ruby. Any other caller could make the same mistake. But, I also understand/agree with fixing the root issue for the sake of other clients.