I built my own comments in my rails app without threading and I want to be able to send reply all notifications for new comments on a project. Would it be best to just store emails into a ruby hash in MySQL and then read from it when necessary? I’m trying to figure out how to insert emails into a hash with keys I don’t have to define, any help?
Share
Assuming you have some column with
stringtype in some mysql table.Use
jsongem. If you don’t havejsongem install it bygem install json.To get ruby hash back use `JSON.parse(obj)’
or
In rails way. In model you can do like this:
Using second will avoid converting from
hashtojsonand vice versa