a tiny mvc framework for php using php-activerecord
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix for Issue #100 "Eager_Loading and association options issue"

authored by

Fedor and committed by
Jacques Fuentes
476255e5 56b5081f

+4 -2
+2
lib/php-activerecord/lib/Relationship.php
··· 147 147 148 148 if (!empty($includes)) 149 149 $options['include'] = $includes; 150 + 151 + $options = $this->unset_non_finder_options($options); 150 152 151 153 $class = $this->class_name; 152 154
+2 -2
lib/php-activerecord/test/RelationshipTest.php
··· 501 501 AuthorWithNonModelRelationship::first()->books; 502 502 } 503 503 504 - public function test_gh93_eager_loading_respects_association_options() 504 + public function test_gh93_and_gh100_eager_loading_respects_association_options() 505 505 { 506 - Venue::$has_many = array(array('events', 'order' => 'id asc', 'conditions' => array('length(title) = ?', 14))); 506 + Venue::$has_many = array(array('events', 'class_name' => 'Event', 'order' => 'id asc', 'conditions' => array('length(title) = ?', 14))); 507 507 $venues = Venue::find(array(2, 6), array('include' => 'events')); 508 508 509 509 $this->assert_sql_has("WHERE length(title) = ? AND venue_id IN(?,?) ORDER BY id asc",ActiveRecord\Table::load('Event')->last_sql);