botvector.net domain for sale $5k usd (negotiable). Em@il me t0: alex at israstage dot com

My Git activity

13 August 2008

acts_as_taggable_on_steroids + Globalize

Okay, situation is:

Parties involved: Rails 2.0.2, Globalize plugin, acts_as_taggable_on_steroids, ME.
(clickables) :)

Having model Event that translates :name, :body, :description with Globalize plugin.
Also Event are acts_as_taggable with acts_at_taggable_on_steroids ...

Ok for now, model works well, translated well, adding/removing/editing tags as well !

The problem is raise when we trying to @tags = Event.tag_cloud
we got :select option not allowed on translatable models (DISTINCT * FROM events .... !! THAT IS BADD !!!

Solution:
Open /ventor/plugin/acts_as_tabbable_on_steroids/lib/acts_as_taggable.rb
FIND:


LINE: 66
def find_tagged_with(*args)
options = find_options_for_find_tagged_with(*args)
options.blank? ? [] : find(:all, options)
end

CHANGE TO:

def find_tagged_with(*args)
options = find_options_for_find_tagged_with(*args)
options.blank? ? [] : untranslated_find(:all, options)
end


Restart server and you're done !

p.s. More info about great acts_as_taggable_on_steroid plugin is here.

No comments: