[Jifty-commit] r2630 - in Jifty-DBI/branches/od: . lib/Jifty
lib/Jifty/DBI t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Jan 26 23:12:03 EST 2007
Author: audreyt
Date: Fri Jan 26 23:12:02 2007
New Revision: 2630
Modified:
Jifty-DBI/branches/od/ (props changed)
Jifty-DBI/branches/od/Changes
Jifty-DBI/branches/od/META.yml
Jifty-DBI/branches/od/SIGNATURE
Jifty-DBI/branches/od/debian/changelog
Jifty-DBI/branches/od/lib/Jifty/DBI.pm
Jifty-DBI/branches/od/lib/Jifty/DBI/Column.pm
Jifty-DBI/branches/od/lib/Jifty/DBI/Record.pm
Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm
Jifty-DBI/branches/od/t/01records.t
Log:
* Obsoletes $column->until; write $column->till instead.
Modified: Jifty-DBI/branches/od/Changes
==============================================================================
--- Jifty-DBI/branches/od/Changes (original)
+++ Jifty-DBI/branches/od/Changes Fri Jan 26 23:12:02 2007
@@ -39,6 +39,34 @@
- Switch to Object::Declare for schema declaration, fixing many annoyances such as the inability for two modules to refer to each other in their columns.
- "refers Foo::Bar", a new alias to "refers_to Foo::Bar".
+0.32 Fri Jan 26 20:51:12 CST 2007
+
+- Improved deprecation warning for "length is 42":
+
+ Due to an incompatible API change, the "length" field in
+ Jifty::DBI columns has been renamed to "max_length":
+
+ column foo =>
+ length is 10; # NOT VALID
+
+ Please write this instead:
+
+ column foo =>
+ max_length is 10 # VALID
+
+- Calling 'column' within a schema class is deprecated:
+
+ package TestApp::Address::Schema;
+ column address => ...; # NOT VALID
+
+ Please write this instead:
+
+ package TestApp::Address;
+ use Jifty::DBI::Schema;
+ use Jifty::DBI::Record schema {
+ column address => ...; # VALID
+ };
+
0.31 Fri Jan 26 19:52:08 CST 2007
- load, load_by_cols, load_from_hash and create are now optionally class methods.
Modified: Jifty-DBI/branches/od/META.yml
==============================================================================
Modified: Jifty-DBI/branches/od/SIGNATURE
==============================================================================
Modified: Jifty-DBI/branches/od/debian/changelog
==============================================================================
--- Jifty-DBI/branches/od/debian/changelog (original)
+++ Jifty-DBI/branches/od/debian/changelog Fri Jan 26 23:12:02 2007
@@ -1,3 +1,10 @@
+libjifty-dbi-perl (0.32-1) unstable; urgency=low
+
+ * deprecated use of length
+ * deprecated use of column whitout schema
+
+ -- AGOSTINI Yves <agostini at univ-metz.fr> Fri, 26 Jan 2007 14:47:37 +0100
+
libjifty-dbi-perl (0.31-1) unstable; urgency=low
* - load, load_by_cols, load_from_hash and create are now optionally class methods.
Modified: Jifty-DBI/branches/od/lib/Jifty/DBI.pm
==============================================================================
Modified: Jifty-DBI/branches/od/lib/Jifty/DBI/Column.pm
==============================================================================
--- Jifty-DBI/branches/od/lib/Jifty/DBI/Column.pm (original)
+++ Jifty-DBI/branches/od/lib/Jifty/DBI/Column.pm Fri Jan 26 23:12:02 2007
@@ -79,4 +79,10 @@
sub length { Carp::croak('$column->length is no longer supported; use $column->max_length instead') }
sub until { Carp::croak('$column->until is no longer supported; use $column->till instead') }
+sub until {
+ Carp::carp('$column->until is deprecated; use $column->till instead');
+ my $self = shift;
+ $self->till(@_);
+}
+
1;
Modified: Jifty-DBI/branches/od/lib/Jifty/DBI/Record.pm
==============================================================================
--- Jifty-DBI/branches/od/lib/Jifty/DBI/Record.pm (original)
+++ Jifty-DBI/branches/od/lib/Jifty/DBI/Record.pm Fri Jan 26 23:12:02 2007
@@ -93,6 +93,10 @@
$callback->() if $callback;
}
$class->SUPER::import(@_);
+
+ # Turn off redefinition warnings in the caller's scope
+ @_ = (warnings => 'redefine');
+ goto &warnings::unimport;
}
=head2 id
Modified: Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm
==============================================================================
--- Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm (original)
+++ Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm Fri Jan 26 23:12:02 2007
@@ -253,7 +253,31 @@
my $name = $column->name;
my $from = (caller(2))[0];
- $from =~ s/::Schema//;
+ if ($from =~ s/::Schema$//) {
+ no strict 'refs';
+
+ carp << "." unless $from->{_seen_column_warning}++;
+
+*********************************************************
+
+ Calling 'column' within a schema class is deprecated:
+
+ package $from\::Schema;
+ column $name => ...; # NOT VALID
+
+ Please write this instead:
+
+ package $from;
+ use Jifty::DBI::Schema;
+ use @{[${"$from\::ISA"}[0] || "Jifty::DBI::Record"]} schema {
+ column $name => ...; # VALID
+ };
+
+ Sorry for the inconvenience.
+
+*********************************************************
+.
+ }
croak "Base of schema class $from is not a Jifty::DBI::Record"
unless UNIVERSAL::isa($from, "Jifty::DBI::Record");
@@ -467,6 +491,17 @@
What application version this column was last changed. Correct usage
is C<since '0.1.5'>.
+=head2 till
+
+What application version this column was last supported. Correct usage
+is C<till '0.2.5'>.
+
+=cut
+
+sub till {
+ _list( till => @_ );
+}
+
=head2 valid_values
A list of valid values for this column. Jifty will use this to
Modified: Jifty-DBI/branches/od/t/01records.t
==============================================================================
More information about the Jifty-commit
mailing list