EctoInterface (ecto_interface v3.0.0)

EctoInterface is a suite of commonly defined APIs for Ecto-based models. Almost all of these came from the normal generated content in a new phoenix project, simply unifying and expanding on that suite.

Summary

Functions

Using this expression in your context module

Functions

Link to this macro

__using__(list)

(macro)

Using this expression in your context module:

use(EctoInterface, [Core.Commerce.Product, :products, :product])

Will automatically define a whole suite of functions for that schema.

You can also get specific about which changesets are used (default is schema.changeset/1):

use(EctoInterface, [Core.Commerce.Product, :products, :product, :simple_changeset])

And also if you need to differentiate between insert and update changesets:

use(EctoInterface, [Core.Commerce.Product, :products, :product, :create_changeset, :update_changeset])