Localize.UnitWithUsage.Ecto.Composite.Type (Localize Units SQL v2.1.0)

Copy Markdown View Source

Implements the Ecto.Type behaviour for a user-defined Postgres composite type called :cldr_unit_with_usage.

This is the preferred option for Postgres databases since the serialized unit value is stored as a decimal number and the unit usage is preserved across the round trip.

Summary

Functions

Returns whether a unit is blank, which it never is.

Functions

blank?(unit)

Returns whether a unit is blank, which it never is.

Arguments

  • unit is any term.

Returns

  • false.

Examples

iex> Localize.UnitWithUsage.Ecto.Composite.Type.blank?(Localize.Unit.new!(1, "meter"))
false