Tangram uses a table to save the state of the collection. The table has three columns, which contain

the id of the container object

the position of the element in the array

the value of the element

The field names are passed in a hash that associates a field name with a field descriptor. The field descriptor may be either a hash or a string. The hash uses the following fields:

type

table

sql

Optional field type specifies the type of the elements. If the type is stringTangram quotes the values as they are passed to the database. Not specifying a type is exactly equivalent to specifying string.

Optional field table sets the name of the table that contains the elements. This defaults to 'C_F', where C is the class of the containing object and F is the field name.

Optional field sql specifies the type that deploy() (see Tangram::Deploy) should use for the column containing the elements. If this field is not present, the SQL type is derived from the type field: if type is string (or is absent) VARCHAR(255) is used; otherwise, the type field is interpreted as a SQL type.

If the descriptor is a string, it is interpreted as the value of the type field and all the other fields take the default value.

Module Install Instructions

To install Tangram::Type::Array::Scalar, simply copy and paste either of the commands in to your terminal