Changed stored_model and stored_result_source attributes to methods for ACCEPT_CONTEX...
Alexander Hartmaier [Wed, 10 Aug 2011 10:47:13 +0000 (12:47 +0200)]
Changes
lib/Catalyst/Controller/DBIC/API/StoredResultSource.pm

diff --git a/Changes b/Changes
index b57653a..251b58d 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
 Revision history for Catalyst-Controller-DBIC-API: {{ $dist->version }}
 
 {{ $NEXT }}
+- Changed stored_model and stored_result_source attributes to methods for
+  ACCEPT_CONTEXT/Catalyst::Component::InstancePerContext compatibility
 
 2.003002  2011-05-09 12:30:01 Europe/Vienna
 
index 5d81b39..a6c301c 100644 (file)
@@ -25,42 +25,28 @@ result_class is the name of the resultset class that is the model for this contr
 
 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>
+=method_public stored_result_source
 
 This is the result source for the controller
 
 =cut
 
-has 'stored_result_source' =>
-(
-    is => 'ro',
-    isa => ResultSource,
-    lazy_build => 1,
-);
+sub stored_result_source
+{
+    return shift->stored_model->result_source;
+}
 
-=attribute_public stored_model is: ro, isa: L<Catalyst::Controller::DBIC::API::Types/Model>
+=method_public stored_model
 
 This is the model for the controller
 
 =cut
 
-has 'stored_model' =>
-(
-    is => 'ro',
-    isa => Model,
-    lazy_build => 1,
-);
-
-sub _build_stored_model
+sub stored_model
 {
     return $_[0]->_application->model($_[0]->class);
 }
 
-sub _build_stored_result_source
-{
-    return shift->stored_model->result_source();
-}
-
 =method_public check_has_column
 
 Convenience method for checking if the column exists in the result source