From: Jess Robinson Date: Tue, 8 May 2007 20:08:06 +0000 (+0000) Subject: Merge 'DBIx-Class-current' into 'bulk_create' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c586dc2c76453bf31d8d140299e806f88050b8c2;p=dbsrgits%2FDBIx-Class-Historic.git Merge 'DBIx-Class-current' into 'bulk_create' r3267@lilith (orig r3265): ash | 2007-05-08 20:35:36 +0100 Unbreak back-compat r3268@lilith (orig r3266): ash | 2007-05-08 20:41:38 +0100 Move -result_source handling further up --- c586dc2c76453bf31d8d140299e806f88050b8c2 diff --cc lib/DBIx/Class/Row.pm index 52e0ffe,66c6cfb..5b9a3b9 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@@ -28,23 -27,10 +28,23 @@@ derived from L value mappings passed as a hash ref +Passing an object, or an arrayref of objects as a value will call +L for you. When +passed a hashref or an arrayref of hashrefs as the value, these will +be turned into objects via new_related, and treated as if you had +passed objects. + =cut +## It needs to store the new objects somewhere, and call insert on that list later when insert is called on this object. We may need an accessor for these so the user can retrieve them, if just doing ->new(). +## This only works because DBIC doesnt yet care to check whether the new_related objects have been passed all their mandatory columns +## When doing the later insert, we need to make sure the PKs are set. +## using _relationship_data in new and funky ways.. +## check Relationship::CascadeActions and Relationship::Accessor for compat +## tests! + sub new { - my ($class, $attrs, $source) = @_; + my ($class, $attrs) = @_; $class = ref $class if ref $class; my $new = { _column_data => {} };