I am using devise for users
user belongs_to shop user has_many tasks
shop has_many users shop has_many tasks
task belongs_to user task belongs_to shop
when I create a new task:
current_user.tasks.create(...)
the shop_id gets the value of nil, when I need to be the same shop_id as the user.
when I create a new task
current_user.shop.tasks.create(...)
I get the user_id as nil but gets the right value for the shop_id.
what am I am missing?
thanks in advance.
Aucun commentaire:
Enregistrer un commentaire