Re: belongsto relationship not working

2009-07-22 Thread mike karthauser
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

Re: belongsto relationship not working

2009-07-21 Thread brian
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

Re: belongsto relationship not working

2009-07-21 Thread Travis
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

Re: belongsto relationship not working

2009-07-21 Thread Travis
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

Re: belongsto relationship not working

2009-07-19 Thread Carlos Lavin
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

Re: belongsto relationship not working

2009-07-19 Thread 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 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 >

Re: belongsto relationship not working

2009-07-16 Thread Piotr Kilczuk
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( >            '

belongsto relationship not working

2009-07-16 Thread Travis
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(