remote_db 0.0.2 → 0.0.3
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 +7 -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: 2f13f30015558908476fbb5caf672b8e57d9db23
|
4
|
+
data.tar.gz: 1ef50bbf360259529de1d92169900dba96d45498
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed0efc35aa4f730609f62ade1b3fa81ce48ee3c5b0927b1a83f47c38babab64ddcb3267c42c17143eb9b8fed304a4d31ff33696e8486cd71da427ce9059d61ec
|
7
|
+
data.tar.gz: f695d526a91dc99d559e9ad9f0124087c215252df92362a803a6e685b7969ca7e00b7bb0da78c1d066ca5036b1d9b9e9432f07115207e70cde79ad5dfaacf304
|
@@ -30,15 +30,9 @@ module RemoteDb
|
|
30
30
|
|
31
31
|
def define_base_record
|
32
32
|
connection_spec = configuration.connection_spec
|
33
|
-
module_name = self.name
|
34
33
|
klass = Class.new(ActiveRecord::Base) do
|
35
34
|
self.abstract_class = true
|
36
35
|
|
37
|
-
# AR 4 requires AR models to be named.
|
38
|
-
def self.name
|
39
|
-
"#{module_name}::BaseRecord"
|
40
|
-
end
|
41
|
-
|
42
36
|
# Connect via custom db settings
|
43
37
|
establish_connection(connection_spec)
|
44
38
|
|
@@ -48,6 +42,13 @@ module RemoteDb
|
|
48
42
|
# Scope which columns are exposed
|
49
43
|
include Concerns::RestrictedColumns
|
50
44
|
end
|
45
|
+
|
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
|
+
|
51
52
|
self.const_set 'BaseRecord', klass
|
52
53
|
end
|
53
54
|
end
|
data/lib/remote_db/version.rb
CHANGED