filecluster 0.4.18 → 0.4.19

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fc/db.rb +4 -3
  3. data/lib/fc/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fef3c7d2db488cd43e844f7e237e8696f4715ff
4
- data.tar.gz: 88696b276b74b2aec6595798ddfaf3f1909ec2e6
3
+ metadata.gz: aac24b717934dcbd725628834a6b0636b860c019
4
+ data.tar.gz: 790af9f42d49808420ffa79808ad116781b7c175
5
5
  SHA512:
6
- metadata.gz: df5d53cdee92041d9fb71c753d4255edccd2f6a4e5475785063adda9161867b537627e333a41256ea6386be118677ccfdbbe5f3ca2c64d24c594f2db588698b8
7
- data.tar.gz: 1e11a7586394c716a9f42d09063c7716b70d2b173f0a667f6fbec09405479a4b1d7c4ff90bbdbcc21fe3ff70e0a730c1ad89f5cdbf5aa216d723d143ed6d5353
6
+ metadata.gz: 591aec59e41a052db68bc8750d4b30de34ad8b0fbd1e4c9fdf83fdbcd01453629c918af717bf8e5fc0cf6b560031f47a882d746e0221e050ab33c1ea9364fcee
7
+ data.tar.gz: 95c6e59b1fd6de27abcb500bfc9009160f983c26a2cfcaea9f727b74949a9f11e65766e41d6e21124e48a1272d838279c93ea2cc24367a41b8757040bc480541
@@ -14,7 +14,10 @@ module FC
14
14
 
15
15
  def self.connect(options = {})
16
16
  if !@options
17
- if defined?(ActiveRecord::Base) && ActiveRecord::Base.connection
17
+ if options[:host] || options[:database] || options[:username] || options[:password] ||
18
+ !defined?(ActiveRecord::Base) && ActiveRecord::Base.connection
19
+ self.connect_by_config(options)
20
+ else
18
21
  if defined?(Octopus::Proxy) && ActiveRecord::Base.connection.is_a?(Octopus::Proxy)
19
22
  connection = ActiveRecord::Base.connection.select_connection.instance_variable_get(:@connection)
20
23
  else
@@ -25,8 +28,6 @@ module FC
25
28
  @prefix = @options[:prefix].to_s if @options[:prefix]
26
29
  @connects = {} unless @connects
27
30
  @connects[Thread.current.object_id] = connection
28
- else
29
- self.connect_by_config(options)
30
31
  end
31
32
  else
32
33
  @options.merge!(options)
@@ -1,3 +1,3 @@
1
1
  module FC
2
- VERSION = "0.4.18"
2
+ VERSION = "0.4.19"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filecluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.18
4
+ version: 0.4.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - sh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-18 00:00:00.000000000 Z
11
+ date: 2016-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2