Skip Menu |
 

This queue is for tickets about the MooseX-Declare CPAN distribution.

Report information
The Basics
Id: 59263
Status: rejected
Priority: 0/
Queue: MooseX-Declare

People
Owner: Nobody in particular
Requestors: xenoterracide [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: need way to disable moose inline constructor
Download (untitled) / with headers
text/plain 284b
if extending a non moose class you must disable the inline_constructor with make immutable. or if I'm explaining this horribly you have to include this code. __PACKAGE__->meta->make_immutable(inline_constructor => 0); MooseX::Declare does not seem to include a way of doing this.
Download (untitled) / with headers
text/plain 959b
On Sun Jul 11 04:23:43 2010, http://xenoterracide.blogspot.com/ wrote: Show quoted text
> if extending a non moose class you must disable the inline_constructor > with make immutable. or if I'm explaining this horribly you have to > include this code. > > > __PACKAGE__->meta->make_immutable(inline_constructor => 0); > > MooseX::Declare does not seem to include a way of doing this.
I usually "do it by hand", like: use MooseX::Declare; class Freestock::Schema::DefaultRS extends Freestock::Schema::ResultSet { __PACKAGE__->meta->make_immutable(inline_constructor => 0); } 1 The key bit seems to be I need to add the "1" at the end (doing this seems to kill the automatic return 1 feature) and that it needs to be the last thing I do. If there's a better way would be happy to hear about it. I end up needing to do this on all my MX:D extended DBIC stuff (Personally I find MXD most usual at the biz logic level and nearly all that is in my DBIC classes) John
Download (untitled) / with headers
text/plain 219b
This is the right way of doing this: class Foo is mutable { __PACKAGE__->meta->make_immutable(@any_immutable_options_you_want); } Patches for making this clearer in the documentation would be much appreciated!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.