ActiveModel https://github.com/rails/rails/tree/master/activemodel
Think of a super model that constantly needs to be tested.
ActiveModel can be used for many things, but is mostly recognized for adding validation support to / db model records.
ActiveRecord https://github.com/rails/rails/tree/master/activerecord
Think of a record as in a table record.
Establishes a mapping between the new class and the existing table in the database.
In the context of an application, these classes are commonly called models. Models can also be connected to other models; this is done by defining associations.
class Firm < ActiveRecord::Base has_many :clients has_one :account belongs_to :conglomerate end
In the background, rails use ActiveRecord to control the circuit and determine the properties for your records, acting as ORM (relational object mapping):
" ORM: An object that wraps a row in a table or database view encapsulates access to the database and adds domain logic to this data."
The diagram describes the recording properties.
ActiveResource https://github.com/rails/activeresource
Think of a resource as R in the URL or resource routing which involves many rails.
Allows you to do things like C , R etrieve, U pdate, or D estroy (CRUD) via HTTP.
tyler = Person.find(1)
When a request is routed to a resource route, a RESTful request matches its corresponding HTTP verbs and their interactions with databases
GET => Person.find(1) POST => Person.new(:name => 'Tyler', :favorite_page => 'stackoverflow') PUT => tyler.save DELETE => tyler.destroy