2
votes

I ran into a problem with ActiveRecord serialization. Apparently, it has trouble serializing hashes where ranges are keys. I found the Rails Lighthouse ticket (https://rails.lighthouseapp.com/projects/8994/tickets/3067-activerecord-cant-deserialize-hashes-with-range-keys). I've never contributed to an open-source project before, and this could very well take way more time and effort than is worth it for me at this point.

I'm just curious as to how one develops a fix and pushes the patch.

EDIT: I found this link on the Lighthouse page: https://rails.lighthouseapp.com/projects/8994/sending-patches

However, I'd still appreciate any tips, advice, pitfalls to avoid etc. For a problem like the serialization, would a fix to the serialization library be better, or perhaps a modification of ActiveRecord/ActiveSupport?

2
Since I hadn't even thought of using ranges as keys, what are the advantage over, say, a string like "1..5" representing a range?Jakob Borg
gist.github.com/561344 It lets me run comparisons on values while still treating those values more as data than as code. It's much more extensible than the 2nd method in the gist if the values are likely to change. The serialized hash is a very clean way to store the values in db (as opposed to normalizing several tables around the comparison--which could easily change in my case)user94154

2 Answers

1
votes

Here's all you'll need http://guides.rubyonrails.org/contributing_to_rails.html, there are some awesome people helping on irc.freenode.net (#rubyonrails, #railsbridge)