Class: Para::ModelFieldParsers::Redactor

Inherits:
Base
  • Object
show all
Defined in:
lib/para/model_field_parsers/redactor.rb

Instance Attribute Summary

Attributes inherited from Base

#fields_hash, #mappings, #model

Instance Method Summary collapse

Methods inherited from Base

#applicable?, #find_attributes_for_mapping, #initialize, register

Constructor Details

This class inherits a constructor from Para::ModelFieldParsers::Base

Instance Method Details

#parse!Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/para/model_field_parsers/redactor.rb', line 6

def parse!
  %w(content description).each do |field_name|
    field = fields_hash[field_name]

    if field && field.type == :text
      fields_hash[field_name] = Para::AttributeField::Redactor.new(
        field.model, name: field_name
      )
    end
  end
end