has_many_polymorphs tagging snafu 0

Posted by andy

I'm working on a Rails 2.0.x project which is a port of a 1.2.x based one. Since acts_as_taggable was obsoleted in 2.0.x I'm using the ultra wicked has_many_polymorphs plugin which comes with a neat Tagging generator. I ran in a bit of problem when I tried tagging an object with the tags "cool mac 2008". It turned out the "2008" is the culprit since the tag_with method that's introduced tries to be really smart about things. I.e. it assumes that if you pass a number in the tag_with string you actually want to use the Tag object with ID=2008. Of course we don't have 2008 tags yet so it breaks down with an exception. The solution was really simple. Just remove the Fixnum check in the lib/lagging_extensions.rb ..

P.S. Better late than never: Happy 2008!!!

Comments

Leave a response

Comment