-use MooseX::Declare;
+package DBIx::Class::ResultSource::MultipleTableInheritance;
+
+use strict;
+use warnings;
+use parent qw(DBIx::Class::ResultSource::View);
+use namespace::autoclean;
+use Method::Signatures::Simple;
+use Carp::Clan qw/^DBIx::Class/;
# how this works:
#
#
# deploying the postgres rules through SQLT may be a pain though.
-class DBIx::Class::ResultSource::MultipleTableInheritance
- extends DBIx::Class::ResultSource::View {
+__PACKAGE__->mk_group_accessors(simple => qw(parent_source));
+
+method new ($class: @args) {
+ my $new = $class->next::method(@args);
+ my $rc = $new->result_class;
+ if (my $meth = $rc->can('result_source_instance')) {
+ $new->parent_source($rc->$meth);
+ }
+ if ($new->schema) {
+ $new->_attach_additional_sources;
+ }
+ return $new;
+}
+
+method _attach_additional_sources () {
+ my $raw_name = $self->_raw_source_name;
+}
+
+method _raw_source_name () {
+ my $base = $self->source_name;
+ confess "Can't generate raw source name when we don't have a source_name"
+ unless $base;
+ return 'Raw::'.$base;
+}
-
-
+method add_columns (@args) {
+ my $ret = $self->next::method(@args);
+ $_->{originally_defined_in} ||= $self->name for values %{$self->_columns};
+ return $ret;
}
1;