Giter Club home page Giter Club logo

Comments (7)

mlncstr avatar mlncstr commented on July 2, 2024

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.

mlncstr avatar mlncstr commented on July 2, 2024

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:inretrieve_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:intable_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:intable_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:inblock 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:inmap'
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:inbuild_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:inwhere'
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:inmodule: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:inrequire'
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:inblock 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:inload_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:inmodule: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:inrequire'
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:ineach'
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:ineach'
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:inrequire'
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:inrequire'
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:inrequire'
from script/rails:6:in `

'

from acts_as_votable.

steverob avatar steverob commented on July 2, 2024

Getting the same thing for mysql too.

from acts_as_votable.

ryanto avatar ryanto commented on July 2, 2024

This should have been fixed with

e52d9e7

from acts_as_votable.

steverob avatar steverob commented on July 2, 2024

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

e52d9e7e52d9e7


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-23215277
.

from acts_as_votable.

ryanto avatar ryanto commented on July 2, 2024

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.

steverob avatar steverob commented on July 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.