class Blog < ActiveRecord::Base
end
Ever wonder how that works? Metaprogramming. enum status: [ :active, :archived ].
validates :status, presence: true
Ever wonder how that works? Metaprogramming.Used the awesome debugger, pry? Ever wonder how that works? Metaprogramming.
`find_by_id` isn't the only thing that's implemented using Metaprogramming. Practically, everything within ActiveModel is achieved through Metaprogramming. It is one very important reason that allows Ruby to be so expressive.