Scopes act as predefined filters on ActiveRecord models.
A scope is defined using the scope class method.
As a simple example, we will use the following model:
class Person < ActiveRecord::Base
#attribute :first_name, :string
#attribute :last_name, :string
#attribute :age, :integer
...