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.
greets
On 14 Feb., 18:22, Pavel Lysov
<pavli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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
> following:
>
> 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:
>
> v1.0.4
> default_join_table = "#{tag_model.table_name}_#{self.table_name}"
>
> v2.0.2
> if tag_model.table_name < self.table_name
> default_join_table =
"#{tag_model.table_name}_#{self.table_name}"
> else
> default_join_table =
"#{self.table_name}_#{tag_model.table_name}"
> end
>
> 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!
> Pavel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---