Active Record is a pattern named by Martin Fowler in his book
Patterns of Enterprise Architecture (ISBN 978-0321127426). It is
a simple pattern where a class represents a table and an
instance represents a row in that class. It is often used by ORM
tools such as Hibernate and NHibernate as it provides a
straightforward mapping between the world of objects and the
world of relational data. Instances of an Active Record are
responsible for loading and storing data, as well as the
business logic that acts on that data. What is ActiveRecord?
ActiveRecord is the Ruby implementation of the Active Record
pattern. The code for ActiveRecord lives in the ActiveRecord
module. This module contains the classes you need to build a
database and to both read from and write to that database.
ActiveRecord is tied in many people’s minds to Rails, however
you can use the code entirely independently of a Rails
application, even down to using migrations to manage the
database. I’ll show you how to do that here and how ActiveRecord