Forum: Ruby on Rails acts_as_taggable patch 3866 needs some testing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
76f86ac45dfa10cc7dc586ea31f3dcb0?d=identicon&s=25 Sean Treadway (Guest)
on 2006-04-20 11:44
(Received via mailing list)
DHH's acts_as_taggable is now much more usable with this patch.

http://dev.rubyonrails.org/ticket/3866

This patch adds scoped finders, documentation, and tests:

# Get tags for all articles in a blog
@blog.articles.tags

# Get tags for articles in a blog published in the last year
@blog.articles.tags :conditions => ['published_at > ?', 1.year.ago]

# Get related tags from article tags in a blog
@blog.articles.find_related_tags ['code', 'rails']

# Get blog articles tagged with any/all tags
@blog.articles.find_tagged_with :all => ['code', 'rails']
@blog.articles.find_tagged_with :any => ['code', 'rails']
@blog.articles.find_tagged_with ['code', 'rails'] # Depreciated
interface

I would appreciate any feedback.

-Sean
A8e44ce1b57c2689d5a7172d15df42b5?d=identicon&s=25 Brian Ford (brixen)
on 2006-04-21 01:16
Hi Sean

I hope I'm not confused and that you are actually referring to this:

http://dev.rubyonrails.org/ticket/3928

This patch looks really good and I'm going to be using/testing it. I was
pulling my hair out a bit with the original. Thanks to everyone who
worked on this.

Brian
76f86ac45dfa10cc7dc586ea31f3dcb0?d=identicon&s=25 Sean Treadway (Guest)
on 2006-04-21 11:17
(Received via mailing list)
Indeed...  Must have copied the URL from another tab.

Extra love for: http://dev.rubyonrails.org/ticket/3928

Thanks,
Sean
Fb4482bd900141ed8bd3f3fcc3723f90?d=identicon&s=25 Luca Mearelli (Guest)
on 2006-04-21 16:17
(Received via mailing list)
Sean Treadway wrote:
> @blog.articles.find_tagged_with :all => ['code', 'rails']
> @blog.articles.find_tagged_with :any => ['code', 'rails']
> @blog.articles.find_tagged_with ['code', 'rails'] # Depreciated  interface
>
> I would appreciate any feedback.
Very very nice!

I'm looking forward to test it in the near future.
(Thanks for having followed up on the initial patches ;-)

bye,
Luca
55c7bed0ac8ac9b9d9ff3b5ee624fa3e?d=identicon&s=25 Hari Rajagopal (haries)
on 2006-06-21 20:18
Hi,
   I am RoR newbie.
Can someone explain How to install these patches?

-Thanks
Hari
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Kevin Olbrich (Guest)
on 2006-06-21 22:24
(Received via mailing list)
On Thursday, April 20, 2006, at 11:43 AM, Sean Treadway wrote:
>@blog.articles.tags :conditions => ['published_at > ?', 1.year.ago]
>
>-Sean
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails

IIRC, the first version had difficulty discriminating between tags in
STI classes.

If you did this...

B < A
and
C < A

and then did

C.find_tagged_with("tag")

it would return all A,B, and C with that tag.

Does this ticket fix that?
_Kevin
This topic is locked and can not be replied to.