Upstream Patch: ORM enhancements for PTA

This commit is contained in:
Deon George 2011-06-26 22:19:53 +10:00
parent 338be6719e
commit 214bc39648

View File

@ -384,7 +384,7 @@ class Kohana_ORM extends Model implements serializable {
foreach ($this->_has_many as $alias => $details)
{
$defaults['model'] = Inflector::singular($alias);
$defaults['model'] = $this->_model_names_plural ? Inflector::singular($alias) : $alias;
$defaults['foreign_key'] = $this->_object_name.$this->_foreign_key_suffix;
$defaults['through'] = NULL;
$defaults['far_key'] = Inflector::singular($alias).$this->_foreign_key_suffix;