I'm trying to modificate the acts_as_taggable_on pluggin, so when you
search various tags (Eg: User.tagged_with("fish, cat", :on
=> :animals), it looks for users with BOTH tags, not just one of them.
I have edited the file acts_as_taggable_on.rb and I have changed the
line:
"conditions << tags.map { |t| sanitize_sql(["#{tags_alias}.name
LIKE ?", t]) }.join(" OR ")"
with
""conditions << tags.map { |t| sanitize_sql(["#{tags_alias}.name
LIKE ?", t]) }.join(" AND ")".
but when I execute the search, the sql sentence that is executed is
the same than before.
I just restarted the console after doing the changes, do I have to do
something else so the changes take effect? (I installed the plugin
through GemPlugins)
Or maybe I'm editing the wrong line?...if someone has done this before
please correct me if I'm wrong!
I have executed:
rake gems:unpack
So now the plugin is in the vendors/gem directory inside my rails
proyect and when I edit it there, the changes take effect.
However I haven't been able to obtain the functionality that I was
looking for in acts_as_taggable_on with the change I made...any ideas?
# Options:
# :exclude - Find models that are not tagged with the given
tags
# :match_all - Find models that match all of the given tags,
not just one
# :conditions - A piece of SQL conditions to add to the
query
# :on - scopes the find to a context