Module: Trek::Formattable

Extended by:
ActiveSupport::Concern
Included in:
Page
Defined in:
app/models/concerns/trek/formattable.rb

Overview

‘Formattable` provides a way to format model attributes, using formatter classes like `TypographyFormatter` (the only provided formatter for now), before they are validated.

Usage:

class Page < ApplicationRecord
  include Trek::Formattable
  format_attributes Trek::TypographyFormatter, :title, :content
end

Constant Summary collapse

FORMATTERS =
[
  Trek::TypographyFormatter
].freeze