Closed ierceg closed 9 years ago
Not sure I understand the question, but maybe neither?
I don't think I ever tested mapsTo
with associations. The functions in utilities.js
are really confusing to work with.
I've made some changes to master. They won't necessarily fix your problem, but they include tests.
Can you please run your code against master, and either add a failing test case, give me a code sample, or tell me how to make it fail?
@dxg Seems to be fixed - I tried two different tests and both passed. Thanks for this!
@dxg I misspoke - one test is still failing, I just didn't have it correctly configured. I'll add the failing test case.
@dxg I rechecked, again, and it works alright. It's the mapped name that has to be specified in the hasOne
(I had column name and then it reverts to the behavior of using NULL for the value of the relationship field)
@dxg When do you expect to bump the package version?
Just published 2.1.25
@dxg Thanks!
I have a model defined with
mapsTo
for each property (table is snake_case while model is camelCase). If I usehasOne
to associate it to another model, the values of association fields are always null. I have tried the following alternatives:Utilities.js
from:to
This 2nd approach works in my tests but it broke other unit tests.
Before I continue I would like to know if I'm on the right track here. Are associations defined per model property name (camelCase in my case) or per table column name (snake_case in my case)?