ArangoXEcto.edge_module

You're seeing just the function edge_module, go back to ArangoXEcto module for more information.
Link to this function

edge_module(from_module, to_module, opts \\ [])

View Source

Specs

edge_module(mod(), mod(), keyword()) :: atom()

Generates a edge schema dynamically

If no collection name is passed in the options, then one is generated using the passed modules.

This will create the Ecto Module in the environment dynamically. It will create it under the closest common parent module of the passed modules plus the Edges alias. For example, if the modules were MyApp.Apple.User and MyApp.Apple.Banana.Post then the edge would be created at MyApp.Apple.Edges.UsersPosts. This assumes that the edge collection name was generated and not passed in, if it was UsersPosts would be replaced with the camelcase of that collection name.

Returns the Edge Module name as an atom.

Parameters

  • from_module - Ecto Schema Module for the from part of the edge
  • to_module - Ecto Schema Module for the to part of the edge
  • opts - Options passed for module generation

Options

  • :collection_name - The name of collection to use instead of generating it

Examples

iex> ArangoXEcto.edge_module(MyProject.User, MyProject.Company, [collection_name: "works_for"])
MyProject.WorksFor

iex> ArangoXEcto.edge_module(MyProject.User, MyProject.Company)
MyProject.UsersCompanies