#1341 ✓duplicate
Kevin Watt

lazy loading groups broken

Reported by Kevin Watt | June 27th, 2010 @ 01:05 PM | in 1.1

They all load separately, no groups are used.

Also, I'd love to be able to set a default group to load everything in. I was going to try to patch lazy_context in PropertySet, but some official way would be nicer.

DataMapper::Model.append_inclusions MassAssignment
class Item
include DataMapper::Resource

property :id, Serial property :title, String, :lazy => [:test] property :rendered, Text, :lazy => [:test] property :created_at, DateTime end

irb(main):003:0> i=Item.first
=> # @rendered= @created_at=Tue, 01 Jan 2002 01:01:01 -0700> irb(main):004:0> i.title
=> "test story" irb(main):005:0> i.rendered
=> "

Please View this story.


in console:

[1m[36mSQL (0.2ms)[0m [1mSELECT id, created_at FROM items ORDER BY id LIMIT 1[0m [1m[35mSQL (0.2ms)[0m SELECT id, title FROM items WHERE id = 1 ORDER BY id [1m[36mSQL (0.2ms)[0m [1mSELECT id, rendered FROM items WHERE id = 1 ORDER BY id[0m

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »