actually I just found that the query is trying to join the primary key in the users table(user_ID) with the primary key in the SalesReps table(salesRep_ID) instead of using the foreign key in the SalesReps table to do the join.
If I have my relations method using BELONGS_TO it tries to join on the wrong columng. If I change it to HAS_ONE the query looks correct but in my actionUpdate() method it's trying to assign FirstName to the users table.
Here is the call stack:
Stack Trace
#0 /Library/WebServer/Documents/thebigads/yii/framework/db/ar/CActiveRecord.php(390): CComponent->__get('FirstName')
#1 /Library/WebServer/Documents/thebigads/yii/framework/web/helpers/CHtml.php(1286): CActiveRecord->__get('FirstName')
#2 /Library/WebServer/Documents/thebigads/yii/framework/web/helpers/CHtml.php(881): CHtml::activeInputField('text', Object(users), 'FirstName', Array)
#3 /Library/WebServer/Documents/thebigads/protected/views/users/_form.php(65): CHtml::activeTextField(Object(users), 'FirstName', Array)
#4 /Library/WebServer/Documents/thebigads/yii/framework/web/CBaseController.php(119): require('/Library/WebSer…')
#5 /Library/WebServer/Documents/thebigads/yii/framework/web/CBaseController.php(88): CBaseController->renderInternal('/Library/WebSer…', Array, true)
#6 /Library/WebServer/Documents/thebigads/yii/framework/web/CController.php(652): CBaseController->renderFile('/Library/WebSer…', Array, true)
#7 /Library/WebServer/Documents/thebigads/protected/views/users/update.php(12): CController->renderPartial('_form', Array)
#8 /Library/WebServer/Documents/thebigads/yii/framework/web/CBaseController.php(119): require('/Library/WebSer…')
#9 /Library/WebServer/Documents/thebigads/yii/framework/web/CBaseController.php(88): CBaseController->renderInternal('/Library/WebSer…', Array, true)
#10 /Library/WebServer/Documents/thebigads/yii/framework/web/CController.php(652): CBaseController->renderFile('/Library/WebSer…', Array, true)
#11 /Library/WebServer/Documents/thebigads/yii/framework/web/CController.php(591): CController->renderPartial('update', Array, true)
#12 /Library/WebServer/Documents/thebigads/protected/controllers/UsersController.php(129): CController->render('update', Array)
#13 /Library/WebServer/Documents/thebigads/yii/framework/web/actions/CInlineAction.php(32): UsersController->actionUpdate()
#14 /Library/WebServer/Documents/thebigads/yii/framework/web/CController.php(265): CInlineAction->run()
#15 /Library/WebServer/Documents/thebigads/yii/framework/web/filters/CFilterChain.php(128): CController->runAction(Object(CInlineAction))
#16 /Library/WebServer/Documents/thebigads/yii/framework/web/filters/CFilter.php(41): CFilterChain->run()
#17 /Library/WebServer/Documents/thebigads/yii/framework/web/CController.php(885): CFilter->filter(Object(CFilterChain))
#18 /Library/WebServer/Documents/thebigads/yii/framework/web/filters/CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
#19 /Library/WebServer/Documents/thebigads/yii/framework/web/filters/CFilterChain.php(125): CInlineFilter->filter(Object(CFilterChain))
#20 /Library/WebServer/Documents/thebigads/yii/framework/web/CController.php(248): CFilterChain->run()
#21 /Library/WebServer/Documents/thebigads/yii/framework/web/CController.php(225): CController->runActionWithFilters(Object(CInlineAction), Array)
#22 /Library/WebServer/Documents/thebigads/yii/framework/web/CWebApplication.php(335): CController->run('update')
#23 /Library/WebServer/Documents/thebigads/yii/framework/web/CWebApplication.php(123): CWebApplication->runController('users/update')
#24 /Library/WebServer/Documents/thebigads/yii/framework/base/CApplication.php(170): CWebApplication->processRequest()
#25 /Library/WebServer/Documents/thebigads/index.php(11): CApplication->run()
#26 {main}