Class: Airtable::ORM::Attributes::AirtableArrayType
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- Airtable::ORM::Attributes::AirtableArrayType
- Defined in:
- lib/airtable/orm/attributes.rb
Overview
Custom type for Airtable arrays (handles record links and multi-selects)
Instance Method Summary collapse
Instance Method Details
#cast(value) ⇒ Object
220 221 222 223 224 225 226 |
# File 'lib/airtable/orm/attributes.rb', line 220 def cast(value) case value when Array then value when nil then [] else [value] end end |
#serialize(value) ⇒ Object
228 229 230 |
# File 'lib/airtable/orm/attributes.rb', line 228 def serialize(value) cast(value) end |