Comments (7)
On line 16 on vote.rb it appears that the connection to the database isn't being made prior to the scope?
scope :up, where(:vote_flag => true)
Error: ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished
from acts_as_votable.
Here's the full error for reference:
/Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activerecord-3.0.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activerecord-3.0.19/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in
retrieve_connection'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activerecord-3.0.19/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in connection' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/arel-2.0.10/lib/arel/table.rb:131:in
table_cache'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/arel-2.0.10/lib/arel/table.rb:126:in tables' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/arel-2.0.10/lib/arel/table.rb:122:in
table_exists?'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/arel-2.0.10/lib/arel/table.rb:101:in []' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activerecord-3.0.19/lib/active_record/relation/predicate_builder.rb:28:in
block in build_from_hash'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activerecord-3.0.19/lib/active_record/relation/predicate_builder.rb:9:in each' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activerecord-3.0.19/lib/active_record/relation/predicate_builder.rb:9:in
map'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activerecord-3.0.19/lib/active_record/relation/predicate_builder.rb:9:in build_from_hash' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activerecord-3.0.19/lib/active_record/relation/query_methods.rb:226:in
build_where'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activerecord-3.0.19/lib/active_record/relation/query_methods.rb:76:in where' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activerecord-3.0.19/lib/active_record/base.rb:447:in
where'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/acts_as_votable-0.5.0/lib/acts_as_votable/vote.rb:16:in <class:Vote>' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/acts_as_votable-0.5.0/lib/acts_as_votable/vote.rb:4:in
module:ActsAsVotable'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/acts_as_votable-0.5.0/lib/acts_as_votable/vote.rb:3:in <top (required)>' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in
require'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in block in require' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:225:in
block in load_dependency'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:597:in new_constants_in' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:225:in
load_dependency'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in require' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/acts_as_votable-0.5.0/lib/acts_as_votable.rb:11:in
module:ActsAsVotable'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/acts_as_votable-0.5.0/lib/acts_as_votable.rb:6:in <top (required)>' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in
require'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in block (2 levels) in require' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in
each'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in block in require' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in
each'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in require' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/bundler-1.2.3/lib/bundler.rb:128:in
require'
from /Users/marklancaster/Sites/wb-intranet/config/application.rb:7:in <top (required)>' from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/railties-3.0.19/lib/rails/commands.rb:15:in
require'
from /Users/marklancaster/.rvm/gems/ruby-1.9.2-p320@teamwoodbolt/gems/railties-3.0.19/lib/rails/commands.rb:15:in <top (required)>' from script/rails:6:in
require'
from script/rails:6:in `
from acts_as_votable.
Getting the same thing for mysql too.
from acts_as_votable.
This should have been fixed with
from acts_as_votable.
Yes it's fixed. But could you explain this issue? Why does it occur?
On Sunday, August 25, 2013, Ryan T wrote:
This should have been fixed with
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-23215277
.
from acts_as_votable.
See "scopes require callable object" in http://blog.remarkablelabs.com/2012/12/what-s-new-in-active-record-rails-4-countdown-to-2013
from acts_as_votable.
Yeah Ryan. I understand that it became mandatory only in Rails 4 to avoid
eager loading of certain queries which if done so would give wrong results.
But not using procs was fine right? The version of rails I used when I got
this error was 3.0!
On Sunday, August 25, 2013, Ryan T wrote:
See "scopes require callable object" in
http://blog.remarkablelabs.com/2012/12/what-s-new-in-active-record-rails-4-countdown-to-2013—
Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-23215669
.
from acts_as_votable.
Related Issues (20)
- Using with UUID's as primary key HOT 1
- N+1 problem with my voters votes. HOT 7
- acts_as_votable issue HOT 5
- CHANGELOG HOT 2
- current_user.voted_for? @post returns false regardless of vote HOT 1
- acts_as_votable_options somehow became nil HOT 5
- How do I get vote weight for a previous vote HOT 1
- Migration Generator on Rails 6 HOT 9
- 0.12.0 => 0.12.1 version upgrade is a bit painful HOT 3
- Destroying voter does not update cached values in votable HOT 2
- undefined local variable or method `acts_as_votable' HOT 4
- Deprecation warning when returning within an ActiveRecord transaction in Rails 6.1
- Update CI matrix HOT 3
- acts_as_votable not compatible with Rails 6.1? HOT 1
- Add news attributes model Vote HOT 1
- Multiple different reactions? HOT 3
- cached_votes_total doesn't update during factory bot tests
- Conflict with active_admin_role gem
- Could not find table "votes"
- How to override the act_as_votable gem table votes in my applicatio
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acts_as_votable.