Hi RA,

* RA Jones <[EMAIL PROTECTED]> [2007-05-11 12:55]:
> In a Cat controller, the equivalent of $schema->source('Foo')
> is $c->model->('Schema::Foo') ?

that returns a ResultSet, not a ResultSource. You get the source
by asking the set for it using… uh… `result_source`.

> my @date_fields = grep { 
> $c->model('Schema::Foo')->column_info($_)->{data_type} eq 'date' } keys 
> %{ $form->field };

That unnecessarily goes down the chain for every key in the hash. 

    my $src = $c->model('Schema::Foo')->result_source;
    
    my @date_fields = (
        grep { $src->column_info($_)->{data_type} eq 'date' }
        keys %{ $form->field }
    );

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to