Is it possible to write a DBIC result class that loads a shared component or mixin/role that defines a column and relation, e.g. something like

__PACKAGE__->add_column( "foobar_id",   { data_type => "integer", is_foreign_key => 1 } ); __PACKAGE__->belongs_to( "foobar", "My::Schema::Result::Foobar", { "id" => "foobar_id" } ); so that this code can be reused in other results? I've experimented with treating this as a component or parent class but get errors: Can't locate object method "result_source_instance" Is there a way to defer running "belongs_to" until after a result source is specified?


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to