Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slash in indexes fails. acts-as-taggable-on #81

Open
emilkarl opened this issue Dec 3, 2016 · 7 comments
Open

Slash in indexes fails. acts-as-taggable-on #81

emilkarl opened this issue Dec 3, 2016 · 7 comments

Comments

@emilkarl
Copy link

emilkarl commented Dec 3, 2016

Tried this with an app that uses acts-as-taggable-on. A reccomended index looks like this but this fails with Rails 4. Any idea how to solve or should the index not be there?

add_index :taggings, [:acts_as_taggable_on/tag_id, :user_id]

@plentz
Copy link
Owner

plentz commented Dec 4, 2016

@emilkarl that's a good question. can you provide a failing case with this or at least the model relevant info?

@jethroo
Copy link

jethroo commented Jan 18, 2018

have this in 3 models with association using class_name happens for has_many and belongs_to (not limited just seeing this for those two in my codebase)

class Corge < ActiveRecord::Base
  has_many   :foo_bars, class_name: Bar::Foo.name
  belongs_to :baz, class_name: Qux::Quux.name
end

results in:

add_index :corges, [:corge_id, :bar/foo_id]
add_index :corges, [:corge_id, :qux/quux_id]

@plentz
Copy link
Owner

plentz commented Mar 4, 2018

@emilkarl @jethroo @SirRawlins @dandrews @olivierbuffon @matthewford which exact version of rails 4 are you using? I'm trying to reproduce it without success.

PS: if someone want to try to create a test case, it will be super helpfull.

@taleh007
Copy link

taleh007 commented Jun 6, 2018

@plentz

  • Rails 4.2.2
  • with 'spree' gem

the same result

add_index :spree_shipments, [:spree/adjustment_id, :spree/order_id]

@sobrinho
Copy link
Contributor

I will make a PR for that.

@emilkarl
Copy link
Author

Close this?

@ericraio
Copy link

Close this?

Is there a PR for this, still needing this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants