remote_db 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/remote_db/concerns/configurable.rb +4 -6
- data/lib/remote_db/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 897782b1480916843610989aeab9f14c1709090e
|
4
|
+
data.tar.gz: fbb1d2b9d1d22335a7a72fe7bbd8461131e0c744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29bce29570019e4e55d7ecdadf7bffdde33caddab0bbf428ce3c105caa1dc45d5bad6b5f39503ab653a3999a1b9af5f97f3bd9ff0326f5206ae07528ba910e99
|
7
|
+
data.tar.gz: d6e08127decae61c17ed6bcbac541de4dcb5e461817f2ff3a31fc24da6448613a0626393b0d8c04653b96bfdcb12cf6ad9ae2e7d3c4200b36881628a5906fe5d
|
@@ -29,10 +29,14 @@ module RemoteDb
|
|
29
29
|
private
|
30
30
|
|
31
31
|
def define_base_record
|
32
|
+
module_name = self.name
|
32
33
|
connection_spec = configuration.connection_spec
|
33
34
|
klass = Class.new(ActiveRecord::Base) do
|
34
35
|
self.abstract_class = true
|
35
36
|
|
37
|
+
# AR 4 requires AR models to be named.
|
38
|
+
define_singleton_method(:name) { "#{module_name}::BaseRecord" }
|
39
|
+
|
36
40
|
# Connect via custom db settings
|
37
41
|
establish_connection(connection_spec)
|
38
42
|
|
@@ -43,12 +47,6 @@ module RemoteDb
|
|
43
47
|
include Concerns::RestrictedColumns
|
44
48
|
end
|
45
49
|
|
46
|
-
# AR 4 requires AR models to be named.
|
47
|
-
module_name = self.name
|
48
|
-
klass.define_singleton_method(:name) do
|
49
|
-
"#{module_name}::BaseRecord"
|
50
|
-
end
|
51
|
-
|
52
50
|
self.const_set 'BaseRecord', klass
|
53
51
|
end
|
54
52
|
end
|
data/lib/remote_db/version.rb
CHANGED