Skip to content

Instantly share code, notes, and snippets.

@marinho10
Last active January 31, 2019 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marinho10/87ab0ca18e674e6548e13796aee3ac59 to your computer and use it in GitHub Desktop.
Save marinho10/87ab0ca18e674e6548e13796aee3ac59 to your computer and use it in GitHub Desktop.
...
def MyApp.Management.Project do
...
many_to_many(
:users,
User,
join_through: "user_project",
on_replace: :delete
)
...
end
...
def MyApp.Accounts.User do
...
many_to_many(
:projects,
Project,
join_through: "user_project",
on_replace: :delete
)
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment