Test that warnings are generated if appclass actions are used
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Component.pm
index 0fbca47..ee1f99a 100644 (file)
@@ -60,7 +60,14 @@ component loader with config() support and a process() method placeholder.
 __PACKAGE__->mk_classdata('_plugins');
 __PACKAGE__->mk_classdata('_config');
 
-has _component_name => ( is => 'ro' );
+has _component_name => ( is => 'ro' ); # Cannot be required => 1 as context
+                                       # class @ISA component - HATE
+# Make accessor callable as a class method, as we need to call setup_actions
+# on the application class, which we don't have an instance of, ewwwww
+around _component_name => sub {
+    my ($orig, $self) = (shift, shift);
+    blessed($self) ? $self->$orig(@_) : $self;
+};
 
 sub BUILDARGS {
     my $class = shift;