Introducing anonymous_active_record
ActiveRecord Without a Database? Replacement for broken Class.new(ActiveRecord::Base).
Very useful in testing Rails apps, and even more so for testing gems without having to specify full blown models.
If you prefer an exceptionally hacky alternative that could also be used for real runtime code, see my other gem activerecord-tablefree!
Installation Add this line to your application’s Gemfile:
gem 'anonymous_active_record' And then execute:
$ bundle Or install it yourself as:
$ gem install anonymous_active_record Usage Require the library in your spec_helper or other test suite boot file.