active-dump 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/active-dump.rb +3 -2
- data/lib/active-dump/version.rb +2 -2
- metadata +2 -2
data/README.md
CHANGED
data/lib/active-dump.rb
CHANGED
@@ -10,6 +10,7 @@
|
|
10
10
|
# -- ; }}}1
|
11
11
|
|
12
12
|
require 'active_record'
|
13
|
+
require 'erb'
|
13
14
|
require 'yaml'
|
14
15
|
|
15
16
|
# namespace
|
@@ -107,8 +108,8 @@ module ActiveDump
|
|
107
108
|
# @todo use model?!
|
108
109
|
def self.connection # {{{1
|
109
110
|
return @connection if @connection
|
110
|
-
unless ActiveRecord::Base.
|
111
|
-
c = YAML.load File.read(CFG_DB)
|
111
|
+
unless (ActiveRecord::Base.connection rescue nil)
|
112
|
+
c = YAML.load ERB.new(File.read(CFG_DB)).result
|
112
113
|
ActiveRecord::Base.establish_connection c[env]
|
113
114
|
end
|
114
115
|
@connection = ActiveRecord::Base.connection
|
data/lib/active-dump/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-dump
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|