We were initially confused about why classes that extend StoreModel::Model did not have the unknown attribute behavior when initialized with new. However, we figured out that instances must be created from a "type", i.e. with .to_type.cast_value. Would you accept a PR that adds two class methods to StoreModel::Model to make this a little more simple?
def from_value(value)
to_type.cast_value(value)
end
def from_values(values)
to_array_type.cast_value(values)
end
We were initially confused about why classes that extend
StoreModel::Model
did not have the unknown attribute behavior when initialized withnew
. However, we figured out that instances must be created from a "type", i.e. with.to_type.cast_value
. Would you accept a PR that adds two class methods toStoreModel::Model
to make this a little more simple??