Open nick-keller opened 6 years ago
Hi @nick-keller, this is a feature used a lot and nobody else reported such issue recently. It might be a configuration issue.
Can you send us the name of your Forest project to dig into this?
Thanks!
Hi @arnaudbesnier, the name of the project is Equify, one of the table where is fails is the Role
table with the column User
.
Thanks for your help ;)
Ok so I figured out what the problem was.
Using sequelize I wrote a getter for the relation Author
that returns a promise.
The getter is very simple and allows you to write await post.author
at anytime to get the author.
In both cases a promise is returned (Not needed in case 1 but it makes the code omogenus).
On my side I can make sure it does not return a promise if the data is already fetched. Simple but against my code guidelines.
On Forest side an await
or a then
can be added.
Thanks @nick-keller for the details, we've never tested the Sequelize getter feature compatibility with Forest. Sorry you did this investigation work for us.
Let's keep this issue open until a fix is implemented.
No problem, I understand this can be an edge case. I'll follow the issue ;)
Expected behavior
I have a table (let's say
Post
) with a foreign key to another table (let's sayAuthor
). The "REFERENCE FIELD" of the tableAuthor
is set to the username. I expect to see the username in the column author of each post and on the "details" view of each post.Actual behavior
Even tho the foreign key in the database is present, the author is missing from both views (table, and details)
Context
^2.14.1
^4.16.3
^4.37.5
postgres