Bug Report #1266
ORM one-to-many relationships should respect related model's table name
| Status: | Closed | Start date: | ||
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 100% |
||
| Category: | Libraries:ORM | |||
| Target version: | 2.3.3 | |||
| Resolution: | fixed | Points: |
Description
When writing the WHERE clause to locate a related model in a one-to-many relationship, the table name of the related model should be used.
Steps to reproduce:
1. Create two models, Model1 and Model2.
2. In Model1, define a $has_many relationship to Model2.
3. In Model2, define a custom table name with $table_name.
4. Query a Model2 instance using Model 1
- The ORM-generated query will use the name of the Model2 object, not the table name.
History
Updated by John Heathco over 2 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset r4340.
Updated by John Heathco over 2 years ago
- Resolution set to fixed