[Jifty-commit] r6139 - in Net-Jifty/branches/classbuilder: .
Jifty commits
jifty-commit at lists.jifty.org
Wed Dec 17 00:06:47 EST 2008
Author: sartak
Date: Wed Dec 17 00:06:47 2008
New Revision: 6139
Modified:
Net-Jifty/branches/classbuilder/ (props changed)
Net-Jifty/branches/classbuilder/lib/Net/Jifty/Record.pm
Log:
r77637 at onn: sartak | 2008-12-17 00:06:44 -0500
Net::Jifty::Record should use Net::Jifty::Meta::Class, which has the connection and model_name
Modified: Net-Jifty/branches/classbuilder/lib/Net/Jifty/Record.pm
==============================================================================
--- Net-Jifty/branches/classbuilder/lib/Net/Jifty/Record.pm (original)
+++ Net-Jifty/branches/classbuilder/lib/Net/Jifty/Record.pm Wed Dec 17 00:06:47 2008
@@ -1,13 +1,8 @@
package Net::Jifty::Record;
+use metaclass 'Net::Jifty::Meta::Class';
use Moose;
use MooseX::AttributeHelpers;
-has connection => (
- is => 'rw',
- isa => 'Net::Jifty',
- required => 1,
-);
-
has auto_update => (
is => 'rw',
isa => 'Bool',
@@ -41,6 +36,15 @@
}
}
+sub delete {
+ my $self = shift;
+ $self->clear_changes;
+ return $self->meta->connection->delete(
+ $self->meta->model_name,
+ id => $self->id,
+ );
+}
+
sub DEMOLISH {
my $self = shift;
$self->update if $self->has_changes;
More information about the Jifty-commit
mailing list