PhoenixFlags.Target.Condition (PhoenixFlags v0.9.0)

Copy Markdown View Source

One condition of a PhoenixFlags.Target: an attribute, an operator, and the values to compare against.

Summary

Functions

Changeset for a condition.

Types

t()

@type t() :: %PhoenixFlags.Target.Condition{
  __meta__: term(),
  attribute: term(),
  id: term(),
  inserted_at: term(),
  operator: term(),
  target: term(),
  target_id: term(),
  updated_at: term(),
  values: term()
}

Functions

changeset(condition, attrs)

Changeset for a condition.

attribute and values are normalised to strings so a rule written with attribute: :company_id, values: [123] matches a context of %{company_id: 123} — see the note on string comparison in PhoenixFlags.Target.