dynamic-active-model 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dynamic-active-model/database.rb +12 -4
- 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: fb9ff04233ee21e4f334a044c977634fe0a375218b87fda3c8aaadfe97b8137c
|
|
4
|
+
data.tar.gz: 9329b32d0761698b7b6b209a17c947da1a10c5bb3611d78a45118011425cb7b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8a27485cf73b32056a961bdaf037818f7789fe88ccd9b0fd267d6c333842716c0bbe007dd23c99e214abcf1619354caf5708af146ea32f6fa3df1512536f4318
|
|
7
|
+
data.tar.gz: '09d22fcaf58beebc39ed805c8974c57173fcb41a625604a6b897b7f99aa680ccbd0dbd0ac2d913022753ffbbf986a569750f0d173a21630998d6a7ba1c271a15'
|
|
@@ -26,14 +26,22 @@ module DynamicActiveModel
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
def skip_tables(tables)
|
|
30
|
+
tables.each { |table| skip_table(table) }
|
|
31
|
+
end
|
|
32
|
+
|
|
29
33
|
def include_table(table)
|
|
30
34
|
if table.is_a?(Regexp)
|
|
31
35
|
@include_table_matchers << table
|
|
32
36
|
else
|
|
33
|
-
@include_tables << table
|
|
37
|
+
@include_tables << table.to_s
|
|
34
38
|
end
|
|
35
39
|
end
|
|
36
40
|
|
|
41
|
+
def include_tables(tables)
|
|
42
|
+
tables.each { |table| include_table(table) }
|
|
43
|
+
end
|
|
44
|
+
|
|
37
45
|
def table_class_name(table_name, class_name)
|
|
38
46
|
@table_class_names[table_name.to_s] = class_name
|
|
39
47
|
end
|
|
@@ -47,18 +55,18 @@ module DynamicActiveModel
|
|
|
47
55
|
end
|
|
48
56
|
end
|
|
49
57
|
|
|
50
|
-
def
|
|
58
|
+
def skipped_tables
|
|
51
59
|
@skip_tables + @skip_table_matchers
|
|
52
60
|
end
|
|
53
61
|
|
|
54
|
-
def
|
|
62
|
+
def included_tables
|
|
55
63
|
@include_tables + @include_table_matchers
|
|
56
64
|
end
|
|
57
65
|
|
|
58
66
|
private
|
|
59
67
|
|
|
60
68
|
def skip_table?(table_name)
|
|
61
|
-
@skip_tables.include?(table_name) ||
|
|
69
|
+
@skip_tables.include?(table_name.to_s) ||
|
|
62
70
|
@skip_table_matchers.any? { |r| r.match(table_name) }
|
|
63
71
|
end
|
|
64
72
|
|
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
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Doug Youch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-07-
|
|
11
|
+
date: 2019-07-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|