Skip to content

Add no_nonmoose option #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/DBIx/Class/Schema/Loader/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/
result_base_class
result_roles
use_moose
no_nonmoose
only_autoclean
overwrite_modifications
dry_run
Expand Down Expand Up @@ -981,6 +982,11 @@ content after the md5 sum also makes the classes immutable.

It is safe to upgrade your existing Schema to this option.

=head2 no_nonmoose

When combined with C<use_moose>, prevents adding L<MooseX::NonMoose> to
result classes (Not recommended!)

=head2 only_autoclean

By default, we use L<MooseX::MarkAsMethods> to remove imported functions from
Expand Down Expand Up @@ -2062,7 +2068,13 @@ sub _dump_to_dir {
unless $result_base_class eq 'DBIx::Class::Core';

if ($self->use_moose) {
$src_text.= qq|use Moose;\nuse MooseX::NonMoose;\nuse $autoclean;|;
my $nonmoose
= $self->no_nonmoose
? ''
: "use MooseX::NonMoose;\n"
;

$src_text.= qq|use Moose;\n${nonmoose}use $autoclean;|;

# these options 'use base' which is compile time
if (@{ $self->left_base_classes } || @{ $self->additional_base_classes }) {
Expand Down