ActiveRecord (Rails)

From Wikipedia, the free encyclopedia

ActiveRecord is a Rails framework that implements the like-named object-relational mapping (ORM) pattern described by Martin Fowler:

An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.

Simply put, it creates a persistable domain model from business objects and database tables, where logic and data are presented as a unified package.

ActiveRecord adds inheritance and associations to the pattern above, solving two substantial limitations of that pattern. A set of macros acts as a domain language for the latter, and the SingleTableInheritance pattern is integrated for the former; thus, ActiveRecord increases the functionality of the active record pattern approach to database interaction.

ActiveRecord is the model part of the web-application framework Rails, and is also a stand-alone ORM package for Ruby. In both forms, it was conceived of by David Heinemeier Hansson, and has been improved upon by a number of contributors.