On 26 August 2010 10:55, DAZ <[email protected]> wrote:
> Hi,
>
> I'm using the following property in a Post class
>
>  property :tags,         String
>
> This is a space separated list of tags for that post.
>
What you want then is

Post.all(:tags.like => "%ruby%").  Though note this will also pick up
posts like rubygem.

> Also, is there a DataMapper function that could create a list of all
> the tags from all posts in a single call?

You'd basically need to fetch all the tag fields, and then split and
count in the ruby process.  To do it with queries, you'd need separate
tag models.

Regards
Jon

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

Reply via email to