define the properties to select without writing my own sql?

3 views
Skip to first unread message

Chris Gunnels

unread,
Jun 8, 2010, 1:38:37 PM6/8/10
to DataMapper
I have been looking all over the web, but can't seem to figure out how
to define the properties i want. What i mean is that I don't want
datamapper to select all properties, I just want to pull the id and
name from the db. I don't want to use lazy loading either. Anybody
know how to do this?

Martin Gamsjaeger

unread,
Jun 8, 2010, 2:07:36 PM6/8/10
to datam...@googlegroups.com
Hey Chris,

You might wanna try

Person.all(:fields => [:id, :name])

cheers
snusnu

> --
> You received this message because you are subscribed to the Google Groups "DataMapper" group.
> To post to this group, send email to datam...@googlegroups.com.
> To unsubscribe from this group, send email to datamapper+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
>
>

Chris Gunnels

unread,
Jun 24, 2010, 5:18:56 PM6/24/10
to DataMapper
Thx, thats what I needed.

Chris Gunnels

unread,
Jun 24, 2010, 5:19:02 PM6/24/10
to DataMapper
Thx, thats what I needed.

On Jun 8, 12:07 pm, Martin Gamsjaeger <gamsnj...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages