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');
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
);
sub _build_stored_model
-{
+{
return $_[0]->_application->model($_[0]->class);
}
sub check_has_relation
{
my ($self, $rel, $other, $nest, $static) = @_;
-
+
$nest ||= $self->stored_result_source;
if(HashRef->check($other))
=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