HABTM COUNT Working but SELECT not adding join table
I've got two tables and a join table:
* drink_reviews
* comments
* comments_drink_reviews
I am trying to paginate on a specific category and here in lies the
problem:
------------------------------------------------
$this->Category->DrinkReview->bindModel(array('hasOne' =>
array('CategoriesDrinkReview')));
$this->paginate = array(
'conditions' => array(
'CategoriesDrinkReview.category_id' => $category['Category']['id']
),
'limit' => 10
);
$reviews = $this->paginate('DrinkReview');
------------------------------------------------
My pagination links (numbers, next, and previous) are all working
correctly and I see that the initial COUNT in order to create the
amount of pages is working correctly, but when it gets to the SELECT
query to get the results, it's saying that it is not performing the
join to the join table and therefor not selecting that table but still
applying the "WHERE CategoriesDrinkReview.category_id = #"
This is tremendously frustrating and if anyone can see any glaring,
immediate issues, I would love to hear it. This join has been a bit of
a jerk from the get-go, if I may be so honest.
I'm running 1.3.3 but might try and upgrade to 1.3.7 in hopes for
success.
Thanks in advance.
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home