# |
Apr 19th 2017, 12:52 |
crazycoder |
i should do AgentsSectors.Sectors |
# |
Apr 19th 2017, 12:52 |
crazycoder |
wait |
# |
Apr 19th 2017, 12:52 |
inoas |
just 1 file, 4 association defintions (1 per side, 2 in join table) and a slight change to the finder |
# |
Apr 19th 2017, 12:52 |
inoas |
your saving doesnt change |
# |
Apr 19th 2017, 12:52 |
inoas |
you database doens't change |
# |
Apr 19th 2017, 12:51 |
inoas |
then the above solution works |
# |
Apr 19th 2017, 12:51 |
inoas |
if you setup hasMany/belongsTo correctly |
# |
Apr 19th 2017, 12:51 |
crazycoder |
yes |
# |
Apr 19th 2017, 12:51 |
inoas |
but it is automatic behavior of belongsToMany |
# |
Apr 19th 2017, 12:51 |
inoas |
I don't know why it fetches the whole _joinData |
# |
Apr 19th 2017, 12:50 |
crazycoder |
i need the sector name |
# |
Apr 19th 2017, 12:50 |
crazycoder |
inoas, it does not really make sense to me....agents_sectors only has agent_id and sector_id |
# |
Apr 19th 2017, 12:45 |
Junior |
thanks! |
# |
Apr 19th 2017, 12:45 |
Junior |
i am as we speak in the aware trait |
# |
Apr 19th 2017, 12:45 |
inoas |
just for checking |
# |
Apr 19th 2017, 12:45 |
inoas |
then add debug calls to the muffin footprint vendor code |
# |
Apr 19th 2017, 12:44 |
Junior |
if exists |
# |
Apr 19th 2017, 12:44 |
inoas |
10-15mins? |
# |
Apr 19th 2017, 12:44 |
Junior |
i need to see somehow what data exists inside the footprint |
# |
Apr 19th 2017, 12:44 |
Junior |
yes... it would take time but if i don't have other option.. |
# |
Apr 19th 2017, 12:44 |
inoas |
whatever, you get what I mean, isolate the issue ;) |
# |
Apr 19th 2017, 12:43 |
inoas |
same database |
# |
Apr 19th 2017, 12:43 |
inoas |
create a git feature branch |
# |
Apr 19th 2017, 12:43 |
inoas |
and work from there |
# |
Apr 19th 2017, 12:43 |
inoas |
and a blank users model without plugin maybe even |
# |
Apr 19th 2017, 12:43 |
inoas |
start with nothing ;p |
# |
Apr 19th 2017, 12:43 |
Junior |
my user model is AuthAcl.Users |
# |
Apr 19th 2017, 12:42 |
Junior |
inoas, no, found it somewhere in the docs to load that way |
# |
Apr 19th 2017, 12:42 |
inoas |
belongsToMany is just a shortcut around hasMany <> belongs to JOIN MODEL belongs to <> hasMany other Model |
# |
Apr 19th 2017, 12:41 |
inoas |
hasMany |
# |
Apr 19th 2017, 12:41 |
inoas |
then make it so |
# |
Apr 19th 2017, 12:39 |
crazycoder |
Agents is not associated with AgentsSectors |
# |
Apr 19th 2017, 12:38 |
inoas |
is that your users model? |
# |
Apr 19th 2017, 12:38 |
inoas |
Junior: why do you have a model named Footprints? |
# |
Apr 19th 2017, 12:38 |
inoas |
and then within that contain Sectors |
# |
Apr 19th 2017, 12:38 |
inoas |
Agents.AgentsSectors = use select here to only specify agent_id and sector id |
# |
Apr 19th 2017, 12:38 |
inoas |
try going through the auto join model |
# |
Apr 19th 2017, 12:37 |
crazycoder |
Agents->find()->contain(the previos code) |
# |
Apr 19th 2017, 12:37 |
crazycoder |
it is a hbtm relationship |
# |
Apr 19th 2017, 12:36 |
inoas |
how does your finder look |
# |
Apr 19th 2017, 12:36 |
crazycoder |
}, |