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

unitialized constant [Class]::Votable? #46

Closed
grimmwerks opened this issue Aug 24, 2013 · 4 comments
Closed

unitialized constant [Class]::Votable? #46

grimmwerks opened this issue Aug 24, 2013 · 4 comments

Comments

@grimmwerks
Copy link

Hey there - followed the directions, did the migrate, etc, added 'acts_as_votable' to my class (Episode) and am getting this in active admin:

Rendered /Users/grimm/.bundler/ruby/1.9.1/active_admin-a9949c152420/app/views/active_admin/resource/index.html.arb (2291.9ms)
Completed 500 Internal Server Error in 2663ms

NameError - uninitialized constant Episode::Votable:
  activerecord (4.0.0) lib/active_record/inheritance.rb:125:in `compute_type'
  activerecord (4.0.0) lib/active_record/reflection.rb:178:in `klass'
  /Users/grimm/.bundler/ruby/1.9.1/ransack-8db7a3c1f424/lib/ransack/adapters/active_record/context.rb:55:in `attribute_method?'
  /Users/grimm/.bundler/ruby/1.9.1/ransack-8db7a3c1f424/lib/ransack/nodes/grouping.rb:130:in `block in attribute_method?'
  /Users/grimm/.bundler/ruby/1.9.1/ransack-8db7a3c1f424/lib/ransack/nodes/grouping.rb:130:in `attribute_method?'
  /Users/grimm/.bundler/ruby/1.9.1/ransack-8db7a3c1f424/lib/ransack/search.rb:86:in `method_missing'
  actionpack (4.0.0) lib/action_view/helpers/tags/base.rb:28:in `value'
  actionpack (4.0.0) lib/action_view/helpers/tags/select.rb:15:in `block in render'
  actionpack (4.0.0) lib/action_view/helpers/tags/select.rb:15:in `render'
  actionpack (4.0.0) lib/action_view/helpers/form_options_helper.rb:151:in `select'
  actionpack (4.0.0) lib/action_view/helpers/form_options_helper.rb:769:in `select'
  /Users/grimm/.bundler/ruby/1.9.1/formtastic-cd6cb88f28ea/lib/formtastic/inputs/select_input.rb:154:in `select_html'
  /Users/grimm/.bundler/ruby/1.9.1/formtastic-cd6cb88f28ea/lib/formtastic/inputs/select_input.rb:149:in `block in to_html'
  actionpack (4.0.0) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
  actionpack (4.0.0) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
  actionpack (4.0.0) lib/action_view/helpers/capture_helper.rb:38:in `capture'
@ryanto
Copy link
Owner

ryanto commented Aug 24, 2013

Does this only exist in active admin? Can you paste the relevant files or create a failing test case?

@grimmwerks
Copy link
Author

I can put together an example - honestly it was just me adding the acts_as_votable to a very thin model:

class Episode < ActiveRecord::Base
    acts_as_votable

    belongs_to :show
    has_one :creator, :through => :show
    has_and_belongs_to_many :categories, :join_table => :categories_episodes

end

There's also this discussion: activeadmin/activeadmin#2378

@ryanto
Copy link
Owner

ryanto commented Aug 24, 2013

Thanks for the link. I think I've fixed this. Can you try installing version 0.7.1 of the gem and let me know if it works?

gem "acts_as_votable", "~> 0.7.1"

Then run bundle update acts_as_votable and restart your rails app.

Let me know if this fixes it. Thanks for reporting the issue.

@grimmwerks
Copy link
Author

That seems to have done it, thanks for the quick fix!

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

2 participants