My app has 3 tables whose names can change based on what happens during the install. I need to be able to set the name of the table on init. I created an _init method and made the change in there.
public static function _init()
{
static::$_table_name = static::$_table_name.'foo';
}
Unfortunately though, when I call the find method, Fuel throws an exception because it can't find the table, except the table it's trying to find is the table WITHOUT the change I made in the _init method.
Model_Position::find(1);
// it's looking for the table positions_ instead of positions_foo
How exactly do I get Fuel to change the table name property on init so that it works as expected?