Miquel Ruiz wrote:
> Hi everybody,
>
> I'm having some problems using together (in the same result class) the
> DynamicSubclass and Preview components. Maybe someone can point out
> what's going on (and maybe someone can point out how to solve it :)).
>
> I have a result class Item, with three subclasses: Service, Component
> and Bundle. In the parent class, i need to use the Preview component, as
> follows:
>
> ###########################################
>
> package MyApp::Schema::Items;
>
> use base qw/DBIx::Class/;
>
> __PACKAGE__->load_components(qw/
> Preview DynamicSubclass Core
> /);
>
> __PACKAGE__->table('items');
>
> __PACKAGE__->typecast_map( item_type => {
> SERVICE => 'MyApp::Schema::Items::Service',
> COMPONENT => 'MyApp::Schema::Items::Component',
> BUNDLE => 'MyApp::Schema::Items::Bundle',
> });
>
> ...
>
> ##############################################
>
> The error appears when doing, with preview_schema activated:
>
> $c->model('MyApp::Schema::Items')->create(\%item_stuff);
>
> returning the following error:
>
> DBIx::Class::ResultSet::create(): No such column 'deleted' at ...
>
Have you actually followed the setup steps as described in the
manual [1]? This is something you got to do manually, Preview
will not do it for you.
[1]
http://search.cpan.org/~lsaunders/DBIx-Class-Preview-1.000002/lib/DBIx/Class/Preview.pm#SETUP
_______________________________________________
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/[email protected]