Forum: Ruby on Rails acts_as_taggable, v1.0.4 and v.2.0.2

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
4e9a08565f64e79a311ae6c679a0fcbb?d=identicon&s=25 Pavel Lysov (Guest)
on 2007-02-14 18:22
(Received via mailing list)
Hi all,

After update to 2.0.2 version of acts_as_taggable plugin, I am having a
lot of exceptions during unit tests run, these exceptions look like the

table not found: "credits_tags"

And that is right, since that table has different name in database, it's
actually called "tags_credits". I've fixed this by adding :join_table
declaration to model, but since I am not sure that is best solution I
decided to diff plugin code among its versions:

default_join_table = "#{tag_model.table_name}_#{self.table_name}"

if tag_model.table_name < self.table_name
  default_join_table = "#{tag_model.table_name}_#{self.table_name}"
  default_join_table = "#{self.table_name}_#{tag_model.table_name}"

Confused a lot... I have no idea why someone needs that condition there,
is it helpful at all? Can you please advice?

Thanks for your help!
D7c511ce5025d37b8c6bd9134e0f2bd9?d=identicon&s=25 Thorsten L (Guest)
on 2007-02-15 10:40
(Received via mailing list)
in has_and_belong_to_many Relationships, rails assumes that the
jointable is named table1_table2, e.g. credits_tags, BUT it is a
convention that the alphabetically "lower" (my damn english) name
comes first.

So following rails conventions, it should be credits_tags, but
tags_waffels. That's what this condition checks.

So it seems the new version of this plugin just tries to follow rails
convention, which is a good thing.

This topic is locked and can not be replied to.