Bug Report #4066

ORM queries alias tables in both singular and plural form in same query

Added by John Heathco over 3 years ago. Updated over 3 years ago.

Status:ClosedStart date:06/28/2011
Priority:NormalDue date:
Assignee:-% Done:


Target version:v3.2.0
Resolution:fixed Points:


ORM queries should use the singular model name for aliasing tables. There is no consistency when using with() in loading related models:


results in:

SELECT `category`.`id` AS `category:id`, `category`.`name` AS `category:name`, `blogs`.* FROM `blogs` LEFT JOIN `categories` AS `category` ON (`category`.`id` = `blogs`.`category_id`)

As you can see, blogs is referred to in the plural while categories is referred to in the singular. Both should be referred to in either singular or plural - I think singular as that is how models are loaded via ORM::factory()

Associated revisions

Revision 3fc6ecaf
Added by jheathco - over 3 years ago

using singular aliases for all orm table references (refs #4066)


#1 Updated by John Heathco over 3 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Also available in: Atom PDF