Work with old and new Moose
Tomas Doran [Fri, 11 Sep 2009 08:18:09 +0000 (08:18 +0000)]
lib/Catalyst/ClassData.pm

index 89cc1fd..cd0ad90 100644 (file)
@@ -49,7 +49,8 @@ sub mk_classdata {
     unless $meta->isa('Class::MOP::Class');
 
   my $was_immutable = $meta->is_immutable;
-  my %immutable_options = $meta->immutable_options;
+  # Need to save immutable_options if they're available from Moose 0.89_02
+  my %immutable_options = $meta->can('immutable_options') ? $meta->immutable_options : ();
 
   $meta->make_mutable if $was_immutable;