On Tue, Jul 26, 2011 at 1:51 PM, <[email protected]> wrote: > Hi > > When I call create on a result set like the same in the catalyst > documentation like > > my $book = $c->model('DB::Book')->create({title => $title, > rating => $rating }); > > I get the following error > > DBIx::Class::ResultSet::create(): Unable to perform storage-dependent > operations with a detached result source (source '_unnamed_' is not > associated with a schema). at > ./catalyst/test/script/../lib/test/Controller/Books.pm line 56
Did you create the Schema classes yourself? or did you use the xxxx_create.pl script? I have found that static creation using the create helper script is the best solution because it gives you the flexibility to extend the DBIC model and it's also very easy to upgrade when your DB changes. The way to use the create script for DBIC is: script/xxxx_create.pl model [model_name] DBIC::Schema [namespace] create=static dbi:[sriver]:dbname=data/catmodels.db [user] [pass] -- Alejandro Imass _______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
