You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm fairly new to Erlang (literally started yesterday) and I'm currently trying to map two models using BossDB, which are AuthenticatedUser and ApiAuth.
Let's assume that ApiAuth is a simple API Token and AuthenticatedUser requires an ApiAuth, and an ApiAuth belongs to only one AuthenticatedUser.
So AuthenticatedUser -> ApiAuth, (One-To-One).
I mapped ApiAuth to belong to only one AuthenticatedUser: -belongs_to(authenticateduser).
And AuthenticatedUser to require an ApiAuth: -has({apiauth,1}).
These are the modules I'm working with:
AuthenticatedUser
% Maps an User Model
-module(authenticateduser,[Id,ApiAuthId]).
% An User model is associated to an auth model
-has({apiauth,1}).
-compile(export_all).
ApiAuth
% Maps an Auth Model
% An Auth model has a token which allows the access to the API
-module(apiauth, [Token]).
% An Auth model belongs to a User (1 - 1)
-belongs_to(authenticateduser).
-compile(export_all).
However, when I try to save a new AuthenticatedUser, it succeeds, even though that it's being created with an invalid ApiAuth persistence ID.
Shouldn't it fail due to not finding the respective ApiAuth ID?
Thanks in advance.
PS: Currently using BossDB integrated in-memory persistence provider
The text was updated successfully, but these errors were encountered:
Good evening guys.
I'm fairly new to Erlang (literally started yesterday) and I'm currently trying to map two models using BossDB, which are AuthenticatedUser and ApiAuth.
Let's assume that ApiAuth is a simple API Token and AuthenticatedUser requires an ApiAuth, and an ApiAuth belongs to only one AuthenticatedUser.
So AuthenticatedUser -> ApiAuth, (One-To-One).
I mapped ApiAuth to belong to only one AuthenticatedUser:
-belongs_to(authenticateduser).
And AuthenticatedUser to require an ApiAuth:
-has({apiauth,1}).
These are the modules I'm working with:
AuthenticatedUser
ApiAuth
However, when I try to save a new AuthenticatedUser, it succeeds, even though that it's being created with an invalid ApiAuth persistence ID.
Shouldn't it fail due to not finding the respective ApiAuth ID?
Thanks in advance.
PS: Currently using BossDB integrated in-memory persistence provider
The text was updated successfully, but these errors were encountered: