Welcome Guest, Not a member yet? Register   Sign In
DataMapper set_join_field in model save function
#1

[eluser]Dracos[/eluser]
I discovered the advanced get page in the DM docs, so I went about eliminating a hack I had done. I have two models, app and user. When an app is created, the logged in user is assigned as the owner by settings the role field in the apps_users table. I had previously accomplished this by having an app_user model that was tied directly to apps_users. Obviously this is wrong.

I managed to nuke all the uses of the app_user model except the one in the custom app:Confusedave() that sets the value of role. The issue is that if I try to do

Code:
$this->set_join_field($this->user, 'role', 'a')

inside app:Confusedave() (after calling parent:Confusedave()), the record in apps_users is never created. The same thing happens if I try to set the join field after app:Confusedave().

Obviously I'm doing something wrong, but what?




Theme © iAndrew 2016 - Forum software by © MyBB