ensembl 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f42c94ee8d83d257d7a8a14bc93e7575378960c
4
- data.tar.gz: bb7fba0cfe944082d157fffb5f572da729593bde
3
+ metadata.gz: c4ac70520dcc5ef2fe51ecf7225730f85f1ac3fd
4
+ data.tar.gz: 68bafb5f5b405ab11ce606da2885d27978fa3320
5
5
  SHA512:
6
- metadata.gz: e445f42acc1f4f1f7cc6e228c98b8854feaf9fb051e40c120f1d15cdf2ad9725b95119af95252f5d83e192e96048951d27d4cfce9a6a393d022b26ef3cad3316
7
- data.tar.gz: ad76ac1961ce9a49b224eda9db098b47cbc4ce8c1369f78545358e36d2c9d8447a3679cc165508c84e1438beec2eb6d147bbe96e1002473294a975432411ac74
6
+ metadata.gz: 8874bde7ed8aed44edec73c73c1dd3f3008b390357cfdd1c3fb414f8e1ff6ab123c934f666f66c74df1063599a1bf1777c6dc349078dc6281b6232edb67d0e49
7
+ data.tar.gz: d2d2d476b200bbb2e7bbb6961e14d9b9f3f15b4478b3bf7f42757c7f8c9d7fc57dc44e8765d81479d6a8771cc958086346b96f9015444d4be8c1a16669352fb6
@@ -7,13 +7,22 @@ module Ensembl
7
7
  end
8
8
  end
9
9
 
10
- class Connection < ConnectionPooledBase
10
+ class Connection < ActiveRecord::Base
11
11
  self.extend Ensembl::TableNameOverrides
12
12
 
13
13
  self.abstract_class = true
14
14
 
15
15
  self.establish_connection :core
16
16
 
17
+ # ConnectionPool implemented from:
18
+ # http://www.lucasallan.com/2014/05/26/fixing-concurrency-issues-with-active-record-in-a-rack-application.html
19
+ singleton_class.send(:alias_method, :original_connection, :connection)
20
+
21
+ def self.connection
22
+ ActiveRecord::Base.connection_pool.with_connection do |conn|
23
+ conn
24
+ end
25
+ end
17
26
  end
18
27
 
19
28
  class ModelBase < Connection
@@ -5,7 +5,7 @@ module Ensembl
5
5
 
6
6
  # ConnectionPool implemented from:
7
7
  # http://www.lucasallan.com/2014/05/26/fixing-concurrency-issues-with-active-record-in-a-rack-application.html
8
- class Connection < ConnectionPooledBase
8
+ class Connection < ActiveRecord::Base
9
9
 
10
10
  self.extend Ensembl::TableNameOverrides
11
11
 
@@ -13,6 +13,15 @@ module Ensembl
13
13
 
14
14
  self.establish_connection :variation
15
15
 
16
+ # ConnectionPool implemented from:
17
+ # http://www.lucasallan.com/2014/05/26/fixing-concurrency-issues-with-active-record-in-a-rack-application.html
18
+ singleton_class.send(:alias_method, :original_connection, :connection)
19
+
20
+ def self.connection
21
+ ActiveRecord::Base.connection_pool.with_connection do |conn|
22
+ conn
23
+ end
24
+ end
16
25
  end
17
26
 
18
27
  class ModelBase < Connection
@@ -1,3 +1,3 @@
1
1
  module Ensembl
2
- VERSION = '0.0.10'
2
+ VERSION = '0.0.11'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ensembl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristjan Metsalu