Module: JSONModel::FormtasticCompatibility
- Extended by:
- ActiveSupport::Concern
- Included in:
- Base
- Defined in:
- lib/jsonmodel/formtastic_compatibility.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#column_for_attribute(attribute) ⇒ Object
7 8 9 |
# File 'lib/jsonmodel/formtastic_compatibility.rb', line 7 def column_for_attribute(attribute) OpenStruct.new(type: column_type_conversion(self.class.schema['properties'][attribute.to_s])) end |
#column_type_conversion(property) ⇒ Object
11 12 13 14 |
# File 'lib/jsonmodel/formtastic_compatibility.rb', line 11 def column_type_conversion(property) return 'string_array' if property['type'] == 'array' && property['items']['type'] == 'string' property['type'] end |