-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
key :organization_id not found #263
Comments
You have to add a belongs to association first: # Schema
schema "users" do
belongs_to Project.Account.Organization
pow_user_fields()
timestamps()
end
# ... # Migration
def change do
alter table(:users) do
add :organization_id, references(:organizations)
end
end
# ... |
I wonder what organization is, is it about administration and managing users levels? |
Organization is just the scope for your user. A common structure is that you have teams on your platform that users belongs to, e.g. how slack works. The example is to show how you can make sure that the user that gets invited will belong to the same team as the inviter. You wouldn't need to use the above unless you have some scope that invited users should belong to. |
wow. |
It can be used that way too, PowInvitation was made to just expose a basic invitation system. It can be used/customized for tons of things. |
man it would be so cool to have a guide on adding |
I’ve it planned for https://powauth.com. Here’s a draft: pow-auth/pow_site#11 (comment) |
hi
I tried to install invitation extension for my project according to its README but when I entered email for inviting an user I got this error:
key :organization_id not found in: %Project.Account.User{__meta__: #Ecto.Schema.Metadata<:loaded, "users">, confirm_password: nil, current_password: nil, email: "[email protected]", email_confirmation_token: "ef6e1f6e-beeb-43e4-b8e3-ae43cf685d83", email_confirmed_at: #DateTime<2019-08-26 14:02:43Z>, id: 5, inserted_at: ~N[2019-08-26 14:02:33], invitation_accepted_at: nil, invitation_token: nil, invited_by: #Ecto.Association.NotLoaded<association :invited_by is not loaded>, invited_by_id: nil, invited_users: #Ecto.Association.NotLoaded<association :invited_users is not loaded>, password: nil, password_hash: "$pbkdf2-sha512$100000$X3UILb2A8IL6sCDzgmzyNA==$zVjYxeaQpkYjNxeFXl4De5wyVtFX2qyxQ4P0ad7UblEI4A6r69jCEiWlcEMKstwzZW8vV9hzWcb63HcVLex54g==", unconfirmed_email: nil, updated_at: ~N[2019-08-26 14:02:43]}
and that was predictable. this is my user module:
so what should I do?
thanks.
The text was updated successfully, but these errors were encountered: