From: Rafael Kitover Date: Thu, 14 May 2009 15:31:40 +0000 (+0000) Subject: C::M::DBIC::Schema - make replicated role work with older DBIC, sort of X-Git-Tag: v0.26~35 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ac63f7fa3b1efb624b19af1ccfeccf1382c7829a;hp=924bf2b9c2401af43810bcca4068de3d6e2fa507;p=catagits%2FCatalyst-Model-DBIC-Schema.git C::M::DBIC::Schema - make replicated role work with older DBIC, sort of --- diff --git a/lib/Catalyst/Model/DBIC/Schema/Role/Replicated.pm b/lib/Catalyst/Model/DBIC/Schema/Role/Replicated.pm index 83eed56..ed727e3 100644 --- a/lib/Catalyst/Model/DBIC/Schema/Role/Replicated.pm +++ b/lib/Catalyst/Model/DBIC/Schema/Role/Replicated.pm @@ -43,6 +43,17 @@ L to C<1> by default, meaning that you have the same chance of reading from master as you do from replicants. Set to C<0> to turn off reads from master. +=head1 NOTE ON L VERSIONS PRIOR TO 0.08103 + +This role will work, however, any C<::Storage::Replicated> options in +L will be ignored, master +connect_info will not be merged to replicants, and +L will be used instead, +with all your reads going only to one of your replicants. You'll also get some +warnings. The C role will also not work. + +Please upgrade. + =head1 CONFIG PARAMETERS =head2 replicants @@ -82,7 +93,7 @@ after setup => sub { after finalize => sub { my $self = shift; - $self->storage->connect_replicants($self->replicants->flatten); + $self->storage->connect_replicants(map [ $_ ], $self->replicants->flatten); }; =head1 SEE ALSO diff --git a/t/lib/TestAppC3Fail/Schema/DB/Users.pm b/t/lib/TestAppC3Fail/Schema/DB/Users.pm new file mode 100644 index 0000000..7683299 --- /dev/null +++ b/t/lib/TestAppC3Fail/Schema/DB/Users.pm @@ -0,0 +1,13 @@ +package TestAppC3Fail::Schema::DB::Users; + +# empty schemas no longer work + +use strict; +use warnings; + +use base 'DBIx::Class'; + +__PACKAGE__->load_components("Core"); +__PACKAGE__->table("users"); + +1;