opened
vovimayhem
username_0
I'm working on a legacy-code project running on Rails 3.2.21, and I'm currently isolating problems with rspec, spring & postgres.

Several gems in the project are adding modules to `ActiveRecord::Base` on load phase, and somehow this is attempting a connection before spring's forking of processes.... which in turn it causes the app to raise the following error whenever I run rspec with the app already preloaded on spring:

```
ActiveRecord::StatementInvalid:
  PG::ConnectionBad: PQsocket() can't get socket descriptor:           SELECT tablename
            FROM pg_tables
            WHERE schemaname = ANY (current_schemas(false))
```

I suspect this is no longer the case on Rails >= 4.x.

Is there a particular reason why [`lib/ancestry/has_ancestry.rb`] is using `class << ActiveRecord::Base` to add the `has_ancestry` method instead of using a module & adding it to `ActiveRecord::Base` inside an `ActiveSupport.on_load` hook? I think this is in fact what's causing all the trouble (for me, at least)
Problem with rails 3.2.x, postgres & spring: PG::ConnectionBad: PQsocket() can't get socket descriptor
issue
created
kbrock
username_1
think this is fixed by 332.

Let me know if this is still a problem
comment
closed
kbrock
username_1
issue