ci-bonfire/Bonfire — pull request #467 by mwhitneysdsu (2012-06-01 17:14:44+00:00)
Title: Updated ModuleBuilder ACL Migration to use active record classes

converted
- $this->db->query("INSERT...") into $this->db->insert(...)
- $this->db->query("SELECT... FROM... WHERE...") into
$this->db->select(...)->get_where(...)
- $this->db->query("DELETE...") into $this->db->delete(...)

Additionally, in creation of the up() function, moved status and description values into
variables to make it easier to change them in the future.

Sample output:
```
public function up()
{
$prefix = $this->db->dbprefix;

// permissions
$permissions_data = array('name' => 'AA_Test.Content.View', 'description' => '', 'status' => 'active',);
$this->db->insert("{$prefix}permissions", $permissions_data);
$role_permissions_data = array('role_id' => '1', 'permission_id' => $this->db->insert_id(),);
$this->db->insert("{$prefix}role_permissions", $role_permissions_data);
...
}

//--------------------------------------------------------------------

public function down()
{
$prefix = $this->db->dbprefix;

// permissions
$query = $this->db->select('permission_id')->get_where("{$prefix}permissions", array('name' => 'AA_Test.Content.View',));
foreach ($query->result_array() as $row)
{
$permission_id = $row['permission_id'];
$this->db->delete("{$prefix}role_permissions", array('permission_id' => $permission_id));
}
$this->db->delete("{$prefix}permissions", array('name' => 'AA_Test.Content.View'));
...
}
```