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

HasAndBelongsToManyAssociation (NameError) #249

Closed
shopuz opened this issue May 30, 2014 · 12 comments
Closed

HasAndBelongsToManyAssociation (NameError) #249

shopuz opened this issue May 30, 2014 · 12 comments

Comments

@shopuz
Copy link

shopuz commented May 30, 2014

Hi I am getting the following error when I try to run the server. The bundle installed successfully though.
.rvm/gems/ruby-2.1.0/bundler/gems/octopus-1a123eadf98c/lib/octopus/has_and_belongs_to_many_association.rb:7:in `<top (required)>': uninitialized constant ActiveRecord::Associations::HasAndBelongsToManyAssociation (NameError)

Regards
Suren

@amitavmohanty01
Copy link

I am seeing the same issue with Rails 4.1.1 and Ruby 2.1.2p95.

vendor/bundle/ruby/2.1.0/gems/ar-octopus-0.8.1/lib/octopus/has_and_belongs_to_many_association.rb:17:in <top (required)>': uninitialized constant ActiveRecord::Associations::HasAndBelongsToManyAssociation (NameError)`

@amitavmohanty01
Copy link

Looking at active_record gem, lib/active_record/associations/has_and_belongs_to_many_association.rb no longer exists.

rails/rails#14682 gives more info on the topic.

I am tempted to comment out lib/octopus.rb:99

@anthonyto
Copy link

@shopuz, @amitavmohanty01 did you ever find a way to resolve this? I ran across the same error when attempting to update to Rails 4.1.1

@anthonyto
Copy link

Going off of @amitavmohanty01, rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb no longer exists, which is problematic as it is explicitly referenced in octopus/lib/octopus/has_and_belongs_to_many_association.rb:7

@shopuz
Copy link
Author

shopuz commented Jun 20, 2014

Sorry @anthonyto , I am holding this feature for my project. May be someone in the development team might figure a solution to this..

@jacobwgillespie
Copy link

Experiencing this issue too - anybody know if there's a simple fix? I don't know enough about the codebase to know what this snippet affects...

@anthonyto
Copy link

This issue is resolved in the newest patch made by @agrobbin. Thanks @agrobbin, you're awesome.

@mcansky
Copy link

mcansky commented Jul 29, 2014

@anthonyto link to the patch ?

@anthonyto
Copy link

@mcansky it's in master branch. Just put the http URL in your gemfile and you should be good to go

@emorikawa
Copy link
Contributor

Until 0.8.3 gets pushed you can:

gem "ar-octopus", git: "git://github.com/tchandy/octopus.git",
                  ref: "76b39116338cc6c0bc1311d8aa6fa4fb50964d84"

Which will ensure you're on commit: 76b3911 which has the fix.

See #225 for more details on @agrobbin's pull request.

@sobrinho
Copy link
Collaborator

This fix is already released, thanks!

@fanjieqi
Copy link

fanjieqi commented Aug 2, 2016

The error would be triggered when rails is upgraded to 5.0.0.
I've watched the source code, and it should add a method naming "rails41_rails5?".
(English isn't my first language, I'm sorry for my grammar error.)

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

No branches or pull requests

8 participants