Posted by Kenneth Kalmer
on May 26, 2008
I checked up on ActiveRecord::Tableless and saw a fork that had some promising changes in, so I set out to pull those changes back to my repo. Seemed simple enough, I followed Steven Bristol’s steps and it worked.
The changes made by Peter Wagenet were simple and very useful, thanks Pete!
I’ll start working on specs for the project closer to the end of the week, for now my focus is on getting BIND DLZ on Rails ready for its first public appearance.
Posted by Kenneth Kalmer
on May 02, 2008
Thanks to Dr Nic Williams for highlighting this at such an awesome time. I’ve got the source for ActiveRecord::Tableless now on GitHub and RubyForge, thanks to git. So you can grab a copy any time you want and contribute patches
Get the code via from here:
git clone git://rubyforge.org/tablelessmodels.git
git clone git://github.com/kennethkalmer/activerecord-tableless-models.git
Leaps like this make sharing code a breeze, and makes one think how far you can still go with git before reaching the limits.
Posted by Kenneth Kalmer
on May 01, 2008
ActiveRecord::Tableless has just been released to Rubyforge.org
First made popular on the (now extinct) RailsWeenie.com fourms, the tableless model has been very popular. Why a tableless model? Read on…
Overview
ActiveRecord::Tableless allows you to create a ActiveRecord model that is not associated with a table in your database. This is a great way to exploit ActiveRecord’s validation features for simple tasks like validating the content of a contact form before sending an email.
Another great use for tableless models is mocking. I use ActiveRecord::Tableless extensively in the specs I write for some of my own ActiveRecord mixin’s without worrying about the tables or test databases being setup.
It works great for non-Rails applications too, just in case
Credits
The original forum post detailing the code is no longer available, not even in Google’s cache search. So unfortunately I cannot credit the original authors fully. The code does however appear on several other sites and is roughly the same than the code provided here.