dynamic-active-model 0.4.3 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dynamic-active-model/factory.rb +8 -0
- data/lib/dynamic-active-model.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cc8a936668196298890d1703df7418953b9fa0c6bc661b9bec5d442ada28cf8
|
4
|
+
data.tar.gz: 7a133dd3834b1cf33b6258c5e51b1e2f82054c08c1c9d1b98ccd0db35336fc57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eeafeee961ab25a6bb201eed73c4086b12e29d87d0874c826b8f875f70af7a1438956424eb8d29544aacddce7e3e29a005c2eafaddc426c5fe101c4ae869142
|
7
|
+
data.tar.gz: 4bd58dacf41d7ef8935592efa9ff3607b55f30b5d172a0350963aa905cd6100320b58b324ff671f0866470993a206b2cb663439690008edf74f619fdabf64502
|
@@ -23,6 +23,7 @@ module DynamicActiveModel
|
|
23
23
|
include DynamicActiveModel::DangerousAttributesPatch
|
24
24
|
end
|
25
25
|
@base_module.const_set(class_name, kls)
|
26
|
+
require_extension(class_name)
|
26
27
|
@base_module.const_get(class_name)
|
27
28
|
end
|
28
29
|
|
@@ -52,5 +53,12 @@ module DynamicActiveModel
|
|
52
53
|
|
53
54
|
class_name
|
54
55
|
end
|
56
|
+
|
57
|
+
def require_extension(class_name)
|
58
|
+
file = File.expand_path(DynamicActiveModel.base_models_path + '/' + class_name.underscore + '.rb')
|
59
|
+
return unless File.exist?(file)
|
60
|
+
|
61
|
+
require file
|
62
|
+
end
|
55
63
|
end
|
56
64
|
end
|
data/lib/dynamic-active-model.rb
CHANGED
@@ -9,4 +9,12 @@ module DynamicActiveModel
|
|
9
9
|
autoload :ForeignKey, 'dynamic-active-model/foreign_key'
|
10
10
|
autoload :Associations, 'dynamic-active-model/associations'
|
11
11
|
autoload :TemplateClassFile, 'dynamic-active-model/template_class_file'
|
12
|
+
|
13
|
+
def self.base_models_path
|
14
|
+
@base_models_path || 'app/models'
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.base_models_path=(path)
|
18
|
+
@base_models_path = path
|
19
|
+
end
|
12
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamic-active-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doug Youch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|