Skip to content

Commit

Permalink
fixing relations
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jan 18, 2010
1 parent 11c9406 commit 4af9024
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions infinitas/management/controllers/modules_controller.php
Expand Up @@ -26,8 +26,8 @@ function admin_add() {

$positions = $this->Module->Position->find('list');
$groups = $this->Module->Group->find('list');
$modulesRoute = $this->Module->ModulesRoute->find('all');
$this->set(compact('positions', 'groups', 'modulesRoute'));
$routes = $this->Module->Route->find('all');
$this->set(compact('positions', 'groups', 'routes'));
}

function admin_edit($id = null) {
Expand Down
4 changes: 2 additions & 2 deletions infinitas/management/models/module.php
Expand Up @@ -26,11 +26,11 @@ class Module extends ManagementAppModel{
);

var $hasAndBelongsToMany = array(
'ModulesRoute' => array(
'Route' => array(
'className' => 'Core.ModulesRoute',
'joinTable' => 'modules_routes',
'foreignKey' => 'module_id',
'associationForeignKey' => 'routes_id',
'associationForeignKey' => 'route_id',
'unique' => true
)
);
Expand Down
2 changes: 1 addition & 1 deletion infinitas/management/models/route.php
Expand Up @@ -44,7 +44,7 @@ class Route extends ManagementAppModel {
'ModulesRoute' => array(
'className' => 'Core.ModulesRoute',
'joinTable' => 'modules_routes',
'foreignKey' => 'routes_id',
'foreignKey' => 'route_id',
'associationForeignKey' => 'module_id',
'unique' => true
)
Expand Down
3 changes: 1 addition & 2 deletions infinitas/management/views/modules/admin_add.ctp
Expand Up @@ -40,8 +40,7 @@
</div>
<div style="width:50%; float:left;">
<?php
pr($modulesRoute);
echo $this->Form->input( 'ModulesRoute' );
echo $this->Form->input( 'Route' );
?>
</div>
<?php
Expand Down

0 comments on commit 4af9024

Please sign in to comment.