I just released Valium 0.5.0. If you were getting single-element array values back when using value(s)_of against a loaded collection, this is now fixed. Thanks to gamov for the report! In other news, if you’ve been following Rails 3.2 news, you may have noticed that Rails core is getting functionality very similar to Valium and attr_bucket, two of my smaller gems. What’s that mean for these gems?
Pluckety pluck pluck
First up, Rails 3.2 has added a pluck method, which functions a lot like Valium, minus the ability to re-use already-loaded attributes and select multiple columns. I made an attempt to get the Valium implementation in to replace pluck, but it was rejected. Valium is currently working just fine for all 3.x versions of Rails, so given the missing functionality (and unfortunate naming) of pluck, I’ll continue to maintain it. It’s a small enough library that the maintenance overhead is minimal.
The attribute store
Rails 3.2 has also added something called the Active Record Store. At first glance, it looks pretty similar to attr_bucket, a library I cooked up last year to satisfy a need in one of my own apps. It allows for a simple database-backed key-value store that piggybacks on the AR serialized attribute support.
Based on a quick review of the Active Record Store code, the implementation in core is, similarly to pluck, pretty simplistic. At this point, I plan to continue to maintain attr_bucket as well. It’s way overdue for some love to allow the use of alternate coders and such in 3.1+.
In the end, the increased visibility for this kind of functionality in core should only be good for Valium and attr_bucket, as people who may not have been aware that such functionality had already been developed will now have reason to go looking for gems when they exhaust the core implementations’ capabilities. As is so often the case in open source, everyone wins. :)comments powered by Disqus