Merge commit 'chris/master' into use_interface_roles
[catagits/CatalystX-DynamicComponent.git] / lib / CatalystX / DynamicComponent / ModelToControllerReflector.pm
index b49a9ac..d697e7c 100644 (file)
@@ -44,15 +44,15 @@ sub _reflect_model_to_controller {
     my %controller_methods;
     # FIXME - Abstract this strategy crap out.
     my $model_methods = $model->meta->get_method_map;
-    my $interface_roles = $model_name->config->{interface_roles};
+    my $interface_roles = $model_name->dynamic_model_config->{interface_roles};
 
     for my $interface_role (@$interface_roles) {
-           for my $required_method ($interface_role->meta->get_required_method_list) {
-                   # Note need to pass model name, as the method actually comes from
-                   # the underlying model class, not the Catalyst shim class we autogenerated.
-                   $controller_methods{$required_method} = 
-                        $app->generate_reflected_controller_action_method($suffix, $model_methods->{$required_method})
-           }
+            for my $required_method ($interface_role->meta->get_required_method_list) {
+                    # Note need to pass model name, as the method actually comes from
+                    # the underlying model class, not the Catalyst shim class we autogenerated.
+                    $controller_methods{$required_method} = 
+                         $app->generate_reflected_controller_action_method($suffix, $model_methods->{$required_method})
+            }
     }
 
     # Shallow copy so we don't stuff method refs in config