First page Back Continue Last page Overview Text

Notes:


Finally, I mentioned earlier that there's a natural human reaction to resist change.

Let's say you have an existing ActiveRecord infrastructure that would be tedious and time consuming to change.

How would you like to be able to use Sequel's powerful filtering and easy DSL while keeping all of your current ActiveRecord behavior?

You can actually do this in a single line of Sequel, though I've broken it into multiple lines here.

You just add a row_proc to the dataset that changes the hash from symbol keys to string keys, and calls the ActiveRecord private class method instantiate with the hash.

That's all it takes, and then your dataset will return ActiveRecord instances.