i suspect your foreign key should be singular - ie 'field_id' ?
On Thu, Jul 16, 2009 at 8:27 PM, Travis wrote:
>
> I have successfully set up other belongsto relationships in this
> program but one does not work
>
> the model code is:
>
> class IrrigationEvent extends AppModel
> {
>var $name
The model filename should be irrigation_event.php
On Tue, Jul 21, 2009 at 12:41 PM, Travis wrote:
>
> I tried changing the name of FK in both the database and model and it
> still does not work. I have used BelongsTo before with plural FK and
> it worked. I wonder if it has something to do with m
I tried changing the name of FK in both the database and model and it
still does not work. I have used BelongsTo before with plural FK and
it worked. I wonder if it has something to do with my code and naming
convention
Names are,
Database = irrigation_events
Model = IrrigationEvent (irrigationEv
I tried changing the name of FK in both the database and model and it
still does not work. I have used BelongsTo before with plural FK and
it worked. I wonder if it has something to do with my code and naming
convention
Names are,
Database = irrigation_events
Model = IrrigationEvent (irrigationEv
Cake expects it to be called field_id... although im not sure that is whats
creating the problem.. give it a shot and let us know
2009/7/19 Travis
>
> "fields_id" is what the FK is called in the table,
>
> I have a table called fields, when I created the foreign key in
> irrigation_events I call
"fields_id" is what the FK is called in the table,
I have a table called fields, when I created the foreign key in
irrigation_events I called it fields_id.
Travis
On Jul 16, 1:30 pm, Piotr Kilczuk wrote:
> Hello,
>
>
>
>
>
> > I have successfully set up other belongsto relationships in this
>
Hello,
> I have successfully set up other belongsto relationships in this
> program but one does not work
>
> the model code is:
>
> class IrrigationEvent extends AppModel
> {
> var $name = 'IrrigationEvent';
> var $useTable = 'irrigation_events';
> var $belongsTo = array(
> '
I have successfully set up other belongsto relationships in this
program but one does not work
the model code is:
class IrrigationEvent extends AppModel
{
var $name = 'IrrigationEvent';
var $useTable = 'irrigation_events';
var $belongsTo = array(
'Field' => array(