With my array helpers you'd write something like this for an insert:
Code:
$post = $this->input->post( );
$post = extract_array( $post, array( 'field_one', 'field_two' ) );
$defaults = array(
'field_one' => null,
'field_two' => null,
);
$data = merge_array( $defaults, $post );
$this->db->insert( 'table', $data );
And an update:
Code:
$data = $this->input->post( );
$data = extract_array( $data, array( $this->primary_key, 'field_one', 'field_two' ) );
$id = $data[ $this->primary_key ];
unset( $data[ $this->primary_key ] );
$this->db->update( 'table', $data, array( $this->primary_key => $id ) );
Perhaps I misunderstood your intent with relationships. Are you using it as a way to join to other tables? I don't use CI's active record class for anything other than basic insert/updates. Everything else I write my own SQL statements with $this->query. CI's database classes are great for escaping and managing transactions but I find the where/join/etc methods too verbose.