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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 752211df3244da637e97b13b02f58b3f5d80302f
4
- data.tar.gz: 10c15cef3df9a127c205067946558b9a56a843a7
3
+ metadata.gz: 2f13f30015558908476fbb5caf672b8e57d9db23
4
+ data.tar.gz: 1ef50bbf360259529de1d92169900dba96d45498
5
5
  SHA512:
6
- metadata.gz: ffc94593c07f83dcdfa8efb41e56a9e700144efe087c78ea845c568fc7d8b4c317be8d2a677222a49d7ce1e11bd885f574a34a5675c09fd5c91d18148952318b
7
- data.tar.gz: 87cb6b9129001fddcbed74d1badf38b8276a624cca41547a7e3598d955f41fc19486a0ebcb903a25944c2b11fec64273d8c01941cf44f7440d0ec1b3c9039bf0
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
@@ -1,3 +1,3 @@
1
1
  module RemoteDb
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omar Skalli