2 answers
0 votes
How can i disable counterCache?
I need to create 1000 model records and i dont want counterCache to update the count in the parent model each time i add a record.
Is there an easy way to disable counterCache and enable it again afterwards?
1 answer
0 votes
habtm Add count to find
I have a habtm relationship between category and company. I'm wanting to retrieve all categories with a count column appended based on times used by companies. Currently I'm only able to retrieve 1 category count rather than all.
0 answers
0 votes
counterCache and Tree behavior
I have Post and Category models. Post belongs to Category, and Category has many Posts. Category behaves like a tree. Now if I put counter cache on belongsTo relationship of Post model I will get number of posts in counter field of categories...
1 answer
0 votes
Redirect after success login
Hello,
i have got a problem with redirecting after success login.
In app_controller have:
function beforeFilter() {
$this->Auth->fields = array(
'email' => 'username',
'password' => 'password'
);
... 1 answer
0 votes
Containable and Calculated Fields
I've got my Song model and a Rating model associated with it. I'm trying to get the average rating of each song.
$this-Song-find('all',
array(
'contain' = array(
'Rating' = array(
'fields' = array('AVG(Rating.value)'),
)
)
)
);
This works for the first...
1 answer
0 votes
counterCache
I'm using counterCache to track the number of chapters that have been posted to their related stories.
This all works fine, apart from the fact that when the chapter_count field in the database gets updated, the modified field for that record does...
1 answer
0 votes
Problem with counting records
Hello,
I'm currently working on app for Voters registering and it's pretty much completed.
I have 5 tables in database: voters, locations, categories, users, statuses.
Table voter is in "belongs to" relationship with other tables and tables have...