Sha256: 99147a781b1b353a323813276d2cd5a3b098a73c1d62f4e0ae57a56165260592
Contents?: true
Size: 469 Bytes
Versions: 11
Compression:
Stored size: 469 Bytes
Contents
module HtmlFormat class Engine < Rails::Engine initializer 'html_format' do ActiveSupport.on_load(:active_record) do include HtmlFormat::ActiveRecord ::ActiveRecord::Result.class_eval do def to_html(**options) HtmlFormat.generate(collect(&:to_h), options) end end end if defined?(Mongoid::Document) Mongoid::Document.include(HtmlFormat::ActiveRecord) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems