From 04b4d9453701de9d19a9bc73851b469dc1f783ab Mon Sep 17 00:00:00 2001 From: Francisco Obispo Date: Wed, 26 Jul 2017 20:42:56 -0700 Subject: [PATCH 1/3] add option to omit view definitions --- lib/DBIx/Class/Schema/Loader/Base.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 9103fafcf..43d5e6e70 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -66,6 +66,7 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/ generated_classes omit_version omit_timestamp + omit_view_definitions relationship_attrs @@ -904,6 +905,10 @@ Omit the package version from the signature comment. Omit the creation timestamp from the signature comment. +=head2 omit_view_definitions + +Omit the creation of view definitions + =head2 custom_column_info Hook for adding extra attributes to the @@ -2626,8 +2631,12 @@ sub _setup_src_meta { $self->_dbic_stmt($table_class, 'table', $table->dbic_name); # Must come after ->table - if ($is_view and my $view_def = $self->_view_definition($table)) { - $self->_dbic_stmt($table_class, 'result_source_instance->view_definition', $view_def); + if ( $is_view + and my $view_def = $self->_view_definition( $table ) + and not $self->omit_view_definitions ) + { + $self->_dbic_stmt( $table_class, + 'result_source_instance->view_definition', $view_def ); } my $cols = $self->_table_columns($table); From 26d3d51706c5f8d7ff1729622f1106ff506e757a Mon Sep 17 00:00:00 2001 From: Francisco Obispo Date: Wed, 26 Jul 2017 20:46:23 -0700 Subject: [PATCH 2/3] Revert "add option to omit view definitions" This reverts commit 04b4d9453701de9d19a9bc73851b469dc1f783ab. --- lib/DBIx/Class/Schema/Loader/Base.pm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 43d5e6e70..9103fafcf 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -66,7 +66,6 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/ generated_classes omit_version omit_timestamp - omit_view_definitions relationship_attrs @@ -905,10 +904,6 @@ Omit the package version from the signature comment. Omit the creation timestamp from the signature comment. -=head2 omit_view_definitions - -Omit the creation of view definitions - =head2 custom_column_info Hook for adding extra attributes to the @@ -2631,12 +2626,8 @@ sub _setup_src_meta { $self->_dbic_stmt($table_class, 'table', $table->dbic_name); # Must come after ->table - if ( $is_view - and my $view_def = $self->_view_definition( $table ) - and not $self->omit_view_definitions ) - { - $self->_dbic_stmt( $table_class, - 'result_source_instance->view_definition', $view_def ); + if ($is_view and my $view_def = $self->_view_definition($table)) { + $self->_dbic_stmt($table_class, 'result_source_instance->view_definition', $view_def); } my $cols = $self->_table_columns($table); From d22e65427b7b8d2a7e49a76b5eb5c9e6effa0a84 Mon Sep 17 00:00:00 2001 From: Francisco Obispo Date: Wed, 26 Jul 2017 20:48:02 -0700 Subject: [PATCH 3/3] add an option to ommit view definitions --- lib/DBIx/Class/Schema/Loader/Base.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 9103fafcf..43d5e6e70 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -66,6 +66,7 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/ generated_classes omit_version omit_timestamp + omit_view_definitions relationship_attrs @@ -904,6 +905,10 @@ Omit the package version from the signature comment. Omit the creation timestamp from the signature comment. +=head2 omit_view_definitions + +Omit the creation of view definitions + =head2 custom_column_info Hook for adding extra attributes to the @@ -2626,8 +2631,12 @@ sub _setup_src_meta { $self->_dbic_stmt($table_class, 'table', $table->dbic_name); # Must come after ->table - if ($is_view and my $view_def = $self->_view_definition($table)) { - $self->_dbic_stmt($table_class, 'result_source_instance->view_definition', $view_def); + if ( $is_view + and my $view_def = $self->_view_definition( $table ) + and not $self->omit_view_definitions ) + { + $self->_dbic_stmt( $table_class, + 'result_source_instance->view_definition', $view_def ); } my $cols = $self->_table_columns($table);