dbhijacker 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dbhijacker (0.9.0)
4
+ dbhijacker (0.9.1)
5
5
  rails (>= 2.3.14)
6
6
 
7
7
  GEM
data/README.rdoc CHANGED
@@ -1,7 +1,14 @@
1
1
  Hijacker
2
2
  ========
3
3
 
4
- One application, multiple client databases. Although customizable, by default uses a combination of database and regular expression matching against the host domain to figure out which database to connect to.
4
+ I don't recommend you use this gem. It is not production quality.
5
+
6
+ Notes for adding thread safety:
7
+ https://github.com/discourse/discourse/blob/691377b5af72ea0f3223223cfb623b991c96cbb8/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb
8
+
9
+ One application, multiple client databases. Although customizable, by default
10
+ uses a combination of database and regular expression matching against the host
11
+ domain to figure out which database to connect to.
5
12
 
6
13
  Example
7
14
  =======
data/dbhijacker.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{dbhijacker}
5
5
  s.homepage = "https://github.com/crystalcommerce/hijacker"
6
- s.version = "0.9.0"
6
+ s.version = "0.9.1"
7
7
 
8
8
  s.license = "MIT"
9
9
 
data/lib/hijacker.rb CHANGED
@@ -172,6 +172,11 @@ module Hijacker
172
172
  sister || master
173
173
  end
174
174
 
175
+ def self.do_hijacking?
176
+ (Hijacker.config[:hosted_environments] || %w[staging production]).
177
+ include?(ENV['RAILS_ENV'] || Rails.env)
178
+ end
179
+
175
180
  # just calling establish_connection doesn't actually check to see if
176
181
  # we've established a VALID connection. a call to connection will check
177
182
  # this, and throw an error if the connection's invalid. It is important
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbhijacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: