Bug Report #1266

ORM one-to-many relationships should respect related model's table name

Added by Jesse Barros - almost 3 years ago. Updated over 2 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:John Heathco % 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

Results:
  • The ORM-generated query will use the name of the Model2 object, not the table name.

patch.txt (741 Bytes) Jesse Barros -, 04/17/2009 09:18 pm

Associated revisions

Revision 4341
Added by John Heathco over 2 years ago

Fixing #1266 for 2.4 branch

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

Also available in: Atom PDF