Diffo.Provider.Changes.Define (Diffo v0.4.1)

Copy Markdown View Source

After-action change for the standard :define pattern.

Applies characteristic_value_updates to the instance's declared typed and dynamic characteristics (Characteristic.update_all/3) and to its declared pools (Pool.update_pools/3), then reloads the result via the resource's primary :read action.

Usage

update :define do
  argument :characteristic_value_updates, {:array, :term}
  change Diffo.Provider.Changes.Define
end

This replaces the hand-written after_action block that threads characteristics(), pools(), Characteristic.update_all/3 and Pool.update_pools/3 together on every consumer.