[jifty-devel] Re: [Jifty-commit] r1144 - in jifty/trunk:
lib/Jifty/Action/Record
Sean E. Millichamp
sean at enertronllc.com
Fri Jun 16 12:24:56 EDT 2006
On Thu, 2006-06-15 at 18:28 -0400, Alex Vandiver wrote:
> On Fri, 2006-06-02 at 13:48 -0400, jifty-commit at lists.jifty.org wrote:
> > r327 at pc102: sean | 2006-06-02 13:46:33 -0400
> > * Skip nonexistant columns when creating records
> What's the rationale for this? In one of our applications, we want to
> be able to create rows in related tables during the ->create() of the
> object, which means passing in arguments that aren't columns. What's to
> be won from stripping them out?
Okay, that makes sense. I hadn't considered that as a use-case at the
time I made that change.
I noticed this when doing something with the password_confirm field (I
don't recall what exactly) and Jifty::Action::Record::Create. I believe
it was a very basic form just using the default take_action with a
password field.
It encountered this check in Jifty::DBI::Record during create:
foreach my $column_name ( keys %attribs ) {
my $column = $self->column($column_name);
unless ($column) {
Carp::confess "$column_name isn't a column we know about";
}
My thought was "well, if it is going to Carp::confess anyway, and we
know we could have at least one field that does not match with a column,
why not just skip the unknown fields".
Perhaps a better fix in Jifty::Action::Record::Create would be to just
check and see if the password_confirm field exists and, if so, skip just
that field.
Thoughts?
Sean
--
Sean E. Millichamp, Enertron LLC, 586-757-1200 x102
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20060616/d3393d80/attachment.pgp
More information about the jifty-devel
mailing list