Attributes API
class Order < ActiveRecord::Base
attribute :price_in_cents, :money
attribute :description, :string, default: "Default description"
attribute :ordered_at, :datetime, default: -> { Time.current }
attribute :tags_not_backed_by_db, :string, array: true
end
order = Order.new
order.price_in_cents = "$10.0"
order.price_in_cents
=> 1000
order.description
=> "Default description"
order.ordered_at
=> "2016-01-01 12:00:00 +0200"
order.tags_not_backed_by_db = ["WhateverItTakes", "5%", "Rich Piana"]
order.tags_not_backed_by_db
=> ["WhateverItTakes", "5%", "Rich Piana"]