You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In a belongs to many relationship, the table option can't be without an underscore (i.e. compositions), but it should be table1_table2. If this structure isn't present it throws an error when splitting the table name. This behaviour isn't necessary when local_foreign_key and other_foreign_key are set.
To Reproduce
Steps to reproduce the behavior:
Create a sample database with two tables and one "belongstomany" table
Create the models for the table
Use the code below for the "belongs to many" relationship
Try to get the related model & see error
Expected behavior
Table works with the two additional options
Screenshots or code snippets
@belongs_to_many(local_foreign_key="donut_id", other_foreign_key="", pivot_id=None, table="compositions", with_fields=["absolute_quantity"])defingredients(self):
"""Get the ingredients for this donut"""fromapp.Models.IngredientimportIngredientreturnIngredient
Desktop (please complete the following information):
OS: Windows
Version 11
What database are you using?
Type: MariaDB
Version 10.6.9
Masonite ORM 2.18.6
The text was updated successfully, but these errors were encountered:
Describe the bug
In a belongs to many relationship, the table option can't be without an underscore (i.e.
compositions
), but it should betable1_table2
. If this structure isn't present it throws an error when splitting the table name. This behaviour isn't necessary whenlocal_foreign_key
andother_foreign_key
are set.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Table works with the two additional options
Screenshots or code snippets
Desktop (please complete the following information):
What database are you using?
The text was updated successfully, but these errors were encountered: