Every repository with this icon (
Every repository with this icon (
| Description: | A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts. edit |
-
It would be very nice if setting the "tag_list" attribute would support the dirty tracking available in ActiveRecord since Rails 2.1:
my_model = MyModel.create :tag_list => 'ruby' my_model.tag_list = 'ruby, rails' my_model.changed? # true my_model.tag_list_changed? # true my_model.tag_list_change # ["ruby", "ruby, rails"] my_model.changes # {"tag_list"=>["ruby", "ruby, rails"]}With such an enhancement, the plugin collectiveidea/acts_as_audited could track changes of tags.
Comments
-
passed-in conditions are not being sanitized, causing some funky behavior with bound parameters; ex: :conditions => [ "foo.id IN (?)", [1,2,3,4,5] ] is being converted to SQL " foo.id in (?) AND 1 AND 2 AND 3 AND 4 AND 5"
here's a fix I applied that appears to be working:
before:
conditions = [
taggable_type, taggable_id, options[:conditions], start_at, end_at ]after:
conditions = [
taggable_type, taggable_id, sanitize_sql(options[:conditions]), start_at, end_at ]Comments
-
tag_counts should work like find, so if I pass a condition:
Challenge.tag_counts/_on(:tags, :conditions => {:opened => false}) // or :conditions => ['challenge.opened = ?', false]just merges the strings improperly : "challenge.opened = ? false" resulting in bad query. seems to me that options.merge({.. is not needed when that can be achieved with_scope.. Will play with this today..
def tag_counts_on(context, options = {}) with_scope :find => options do Tag.find(:all, find_options_for_tag_counts(:on => context.to_s)) end endComments
-
When I run a tag seach with :match_all => true I get the following error.
ActiveRecord::StatementInvalid (PGError: ERROR: column "entries.id" must appear in the GROUP BY clause or be used in an aggregate function : SELECT DISTINCT entries.* FROM "entries" LEFT OUTER JOIN taggings entries_taggings ON entries_taggings.taggable_id = entries.id AND entries_taggings.taggable_type = E'Entry' LEFT OUTER JOIN tags entries_tags ON entries_tags.id = entries_taggings.tag_id WHERE ((context = E'tags' AND entries_tags.name LIKE E'abandoned stairs') AND ("entries"."status" = E'published')) GROUP BY entries_taggings.taggable_id HAVING COUNT(entries_taggings.taggable_id) = 1 ORDER BY published_at DESC LIMIT 30 OFFSET 0):Comments
yep, I'm getting the same thing when deploying on Heroku (postgres) and trying to use find_tagged_with
Processing TagsController#show (for 86.130.208.17 at 2009-07-18 15:26:58) [GET]
Parameters: {"tags"=>["uk"], "action"=>"show", "controller"=>"tags"}ActiveRecord::StatementInvalid (PGError: ERROR: column "links.id" must appear in the GROUP BY clause or be used in an aggregate function
: SELECT DISTINCT links.* FROM "links" LEFT OUTER JOIN taggings links_taggings ON links_taggings.taggable_id = links.id AND links_taggings.taggable_type = E'Link' LEFT OUTER JOIN tags links_tags ON links_tags.id = links_taggings.tag_id WHERE (links_tags.name LIKE E'uk') GROUP BY links_taggings.taggable_id HAVING COUNT(links_taggings.taggable_id) = 1): /home/slugs/29705_7bbcdfd_ee70/mnt/.gems/gems/mbleigh-acts-as-taggable-on-1.0.5/lib/acts_as_taggable_on/acts_as_taggable_on.rb:117:infind_tagged_with' app/controllers/tags_controller.rb:8:inshow' -
In my app for example, top_tags doesn't recognize limits (even when trying different ways such as :limit => 3) and just lists all tags:
b = Blog.find_by_slug 'paulstamatiou-com'
b.top_tags(3)
[#<Tag id: 6, name: "software">, #<Tag id: 15, name: "Apple">, #<Tag id: 32, name: "programming">, #<Tag id: 49, name: "web">, #<Tag id: 220, name: "tech">, #<Tag id: 234, name: "Internet">, #<Tag id: 303, name: "ruby">]Comments
-
Is the "acts_as_taggable_on: initialized properly" message really needed in the logs?
0 comments Created 5 months ago by dolzenkoSubject :)
Not an issue but really, I have a bunch of other plugins in my vendor folder and acts_as_taggable_on is the only one which proudly announces himself in the logs.
Comments
-
Tags count column is missing from migration which breaks count methods
0 comments Created 2 months ago by bgilesAs pointed out by Stuart Henry https://mbleigh.lighthouseapp.com/projects/10116-acts-as-taggable-on/tickets/49-add-count-column-to-tags-table#ticket-49-2, the count column is not included in acts_as_taggable_on_migration. Consequently, tag counts aren't returned for User.skill_counts, etc.
To fix after the fact create a migration that includes the following:
add_column :tags, :count, :integer, :default => 0Comments
-
#find_related_??? does not work properly with postgresql
0 comments Created about 1 month ago by tschmidtI was trying out the AATO gem and found that when I tried to use the #find_related_??? method I was getting the following error:
ActiveRecord::StatementInvalid: PGError: ERROR: column "users.name" must appear in the GROUP BY clause or be used in an aggregate function : SELECT users.*, COUNT(tags.id) AS count FROM users, tags, taggings WHERE (users.id != 1 AND users.id = taggings.taggable_id AND taggings.taggable_type = 'User' AND taggings.tag_id = tags.id AND tags.name IN (E'CSS',E'XHTML',E'HTML',E'Javascript',E'Rails',E'Ruby')) GROUP BY users.id ORDER BY count DESC
My configuration looks like this:
# == Schema Information # # Table name: users # # id :integer not null, primary key # name :string(255) # created_at :datetime # updated_at :datetime # class User < ActiveRecord::Base acts_as_taggable_on :skill end
I tracked the problem to line 280 in the lib/acts_as_taggable_on/acts_as_taggable_on.rb file. I am not sure if this is something that only happens in Postgres or if it is being seen elsewhere. I had to update the line to be
:select => "#{klass.table_name}.id, COUNT(#{Tag.table_name}.id) AS count"instead of
:select => "#{klass.table_name}.*, COUNT(#{Tag.table_name}.id) AS count"I am testing this on an iMac running 10.6.1 with Postgresql 8.3.8. Anyway, other than this minor issue I am very pleased with the gem. Thanks for the great work!
Comments
-
Hello,
why the gem doesn't embed the generator ?
Thanks
FranckComments
-
Acts as taggable joins with the tags tables, and thus the records found are marked ActiveRecord::ReadOnlyRecord. An option to return writeable records is needed. If anything this caveat should be mentioned in the docs.
Comments











