
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
-
Arthur D'Andréa November 7th, 2010 @ 07:27 PM
I also found this problem and created a patch.
It works here and i have added two tests, maybe there is a better implementation, but is a start. -
-
-
Martin Gamsjaeger (snusnu) December 21st, 2010 @ 05:39 PM
- Milestone set to 1.1
- State changed from new to duplicate
- Milestone order changed from 196216 to 0
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »