Welcome Guest, Not a member yet? Register   Sign In
Datamapper get_rules on related tables
#1

[eluser]Dunmail[/eluser]
I have a set of get_rules that format fields depending on user preferences. They work fine when I call get() directly on the model but when fields from the table are pulled in via an include_related() call they don't get run.

Code:
//Here's the validation array within the Club class:
var $validation = array(
            'clubName' => array(
                'label' => 'Club Name',
                'get_rules' => array('format_name')
            )
        );

// So when I do the following, the get_rule is run
$c = new Club();

$c->get();

// When I do this, then the get_rule isn't run
$m = new Member();

$m->include_related('club', array('clubName'));

$m->get();

It looks like the rule is directly hooked in to the primary get() call. So how do I ensure that a get_rule (or similar) is invoked on a field no matter if it's retrieved directly or via a relation?


Messages In This Thread
Datamapper get_rules on related tables - by El Forum - 02-21-2013, 05:53 AM
Datamapper get_rules on related tables - by El Forum - 02-22-2013, 01:39 AM
Datamapper get_rules on related tables - by El Forum - 02-22-2013, 09:27 AM
Datamapper get_rules on related tables - by El Forum - 02-27-2013, 01:40 PM
Datamapper get_rules on related tables - by El Forum - 02-28-2013, 12:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB