use JSON instead of JSON::Any to get rid of the CPAN Testers failures when only JSON...
[catagits/Catalyst-Controller-DBIC-API.git] / lib / Catalyst / Controller / DBIC / API / StoredResultSource.pm
index 3fc3cf4..5d81b39 100644 (file)
@@ -1,5 +1,5 @@
 package Catalyst::Controller::DBIC::API::StoredResultSource;
-#ABSTRACT: Provides acessors for static resources
+#ABSTRACT: Provides accessors for static resources
 
 use Moose::Role;
 use MooseX::Types::Moose(':all');
@@ -17,6 +17,14 @@ class is the name of the class that is the model for this controller
 
 has 'class' => ( is => 'ro', isa => Str, writer => '_set_class' );
 
+=attribute_public result_class is: ro, isa: Str
+
+result_class is the name of the resultset class that is the model for this controller
+
+=cut
+
+has 'result_class' => ( is => 'ro', isa => Str, default => 'DBIx::Class::ResultClass::HashRefInflator' );
+
 =attribute_public stored_result_source is: ro, isa: L<Catalyst::Controller::DBIC::API::Types/ResultSource>
 
 This is the result source for the controller
@@ -44,7 +52,7 @@ has 'stored_model' =>
 );
 
 sub _build_stored_model
-{   
+{
     return $_[0]->_application->model($_[0]->class);
 }
 
@@ -75,7 +83,7 @@ check_has_relation meticulously delves into the result sources relationships to
 sub check_has_relation
 {
     my ($self, $rel, $other, $nest, $static) = @_;
-    
+
     $nest ||= $self->stored_result_source;
 
     if(HashRef->check($other))
@@ -99,14 +107,14 @@ sub check_has_relation
 
 =method_public check_column_relation
 
-Convenience method to first check if the provided argument is a valid relation (if it is a HashRef) or column. 
+Convenience method to first check if the provided argument is a valid relation (if it is a HashRef) or column.
 
 =cut
 
 sub check_column_relation
 {
     my ($self, $col_rel, $static) = @_;
-    
+
     if(HashRef->check($col_rel))
     {
         try