views:

77

answers:

2

Hi, when using scaffolding on a controller the views render fine and the app even attempts to insert the data; the problem is that the scaffold is completely ignoring the relations I'm defining in my model class, in fact it's ignoring the class entirely as I can delete the file and the controller still scaffolds and render the crud from the table.

Has this ever happened to you?

Edit to add: Ok this just got weirder, I check my naming conventions and they are allright and to make things worse it's not only happening on scaffolding, I just created a simple table: id, name and country_id and it's ignoring my model file here too even without scaffolding.

Added more info for this question here: http://stackoverflow.com/questions/2945879/why-are-some-classes-created-on-the-fly-and-others-arent-in-cakephp-1-2-7

+2  A: 

This probably means you have some sort of naming problem with your model and Cake is not using it to begin with, but makes up its own on the fly. Cake's automagic only works if you follow its naming conventions.

It's hard to say without more details though.

deceze
My thoughts exactly, thanks man I'll take a look at it now in the morning with a rested head.
JoseMarmolejos
It's always the naming that catches me out. Read the docs again and make sure you have followed it, all down to the last case sensitive char :) Last time it was because I named my model class files in Camel case.
Wizzard
A: 

Sometimes, Cake caches too much for your own good. Try deleting the contents of the tmp/cache/ dir inside the cake dir structure and see if the errors keep appearing.

Adriano Varoli Piazza
Tried that too, no luck. I'm running out of ideas here :s
JoseMarmolejos