On Tue, May 22, 2007 at 06:53:00AM -0700, [EMAIL PROTECTED] wrote: > > On 5/22/07, Adam Bartosik <[EMAIL PROTECTED]> wrote: > > > I doubt there's anything worth porting in ActiveRecord that one of the > > many Perl options (DBIx::Class, Rose::DB::Object, Class::DBI, Tangram, > > Alzabo) doesn't provide. > > > > - Perrin > > one thing i really like about AR is the association proxies, where > relationships themselves are objects you can call methods (ie, find) on
DBIC relationships return resultset objects in scalar context: > class User < ActiveRecord::Base > has_many :items __PACKAGE__->has_many('items', 'MyApp::DB::Item'); > end > class Item < ActiveRecord::Base > belongs_to :user __PACKAGE__->belongs_to('user', 'MyApp::DB::User'); > end > > items = user.items my @items = $user->items; or my $items_rs = $user->items; > item = user.items.find(params[:id]) my $item = $user->items->find($item_id); > new_item = user.items.create!(params[:item]) my $new_item = $user->items->create(\%item_info); > you can get close to that with RDBO's $user->find_items() (and maybe DBIC > has something similarish) but the ruby way here feels so much better! How? -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Director Want a managed development or deployment platform? Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/ _______________________________________________ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/