Skip to content

Commit

Permalink
Rename row_class_prefix -> default_row_class_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
aereal committed Jan 26, 2015
1 parent c480e01 commit 1fb221b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/Teng/Schema/Declare.pm
Expand Up @@ -15,7 +15,7 @@ our @EXPORT = qw(
base_row_class
inflate
deflate
row_class_prefix
default_row_class_prefix
);
our $CURRENT_SCHEMA_CLASS;

Expand All @@ -31,14 +31,14 @@ sub base_row_class($) {
$current->{__base_row_class} = $_[0];
}

sub row_class_prefix ($) {
_current_schema()->{__row_class_prefix} = $_[0];
sub default_row_class_prefix ($) {
_current_schema()->{__default_row_class_prefix} = $_[0];
}

sub row_namespace ($) {
my $table_name = shift;

my $prefix = defined(_current_schema()->{__row_class_prefix}) ? _current_schema()->{__row_class_prefix} : do {
my $prefix = defined(_current_schema()->{__default_row_class_prefix}) ? _current_schema()->{__default_row_class_prefix} : do {
(my $caller = caller(1)) =~ s/::Schema$//;
join '::', $caller, 'Row';
};
Expand Down Expand Up @@ -223,9 +223,9 @@ Default value is L<Teng::Row>.
This option is useful when you adds features for My::DB::Row class.
=item C<row_class_prefix>
=item C<default_row_class_prefix>
Specify the prefix of row class.
Specify the default prefix of row class.
Default value is determined by the schema class.
Expand Down
2 changes: 1 addition & 1 deletion t/001_basic/017_row_class_prefix.t
Expand Up @@ -4,7 +4,7 @@ use Teng::Schema::Declare;

subtest 'with prefix' => sub {
my $schema = schema {
row_class_prefix 'My::Entity';
default_row_class_prefix 'My::Entity';
table {
name 'body';
columns qw(id);
Expand Down

0 comments on commit 1fb221b

Please sign in to comment.