in reply to DBIx::Class Result classes using Moose
Using Moose Roles in ResultSet Classes
turns out that this is a bit more tricky and needs some more magic. Thanks to the folks over on irc I found out that you need to fiddle with the BUILDARGS to make it work. So, the above code works for Result classes, while the following will enable Moose in your ResultSet classes:package MyApp::Schema::ResultSet::Foo; use strict; use warnings; use Moose; use MooseX::NonMoose; use MooseX::MarkAsMethods autoclean => 1; extends 'DBIx::Class::ResultSet'; with 'SomeOldRole'; # insert your Role here... # This is the crucial bit - don't ask.... sub BUILDARGS { $_[2] } ### your ResultSet methods here ### __PACKAGE__->meta->make_immutable; 1;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: DBIx::Class Result classes using Moose
by mcsnolte (Initiate) on Aug 13, 2012 at 17:20 UTC | |
by tospo (Hermit) on Sep 17, 2012 at 21:27 UTC |
In Section
Meditations