exwiw 0.3.6 → 0.3.7
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/CHANGELOG.md +4 -0
- data/lib/exwiw/table_config.rb +14 -0
- data/lib/exwiw/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 91f070d56a04f45680e1c858109fd6828d69220373ad725d07c248d4c8ed2f10
|
|
4
|
+
data.tar.gz: a2dc34318e0c0a15ec8af84d75330b92ce5278c14a5b88d6e824e26bc5b1f6a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5700d2fd7287c365ef6c9759fd7f5e85188db6e568b32f8c29a4a0f9f3479d967014a1f77bbf64e1d0e20fdfd75004d05e86e5152d781d6fcae8a5cbf82bca1b
|
|
7
|
+
data.tar.gz: '09d1f99b70a0f7d0a8e12fbb0f69de776b9932db9fdc386b71fb3822ee118eda786be79737e3a2e85c340d8c6ce15e5bca472e61d4f4f6517f0bc34d133db9d1'
|
data/CHANGELOG.md
CHANGED
data/lib/exwiw/table_config.rb
CHANGED
|
@@ -61,6 +61,20 @@ module Exwiw
|
|
|
61
61
|
def reject_ignored_members!
|
|
62
62
|
self.belongs_tos = belongs_tos.reject(&:ignore)
|
|
63
63
|
self.columns = columns.reject(&:ignore)
|
|
64
|
+
|
|
65
|
+
# A table that will be extracted needs at least one effective column;
|
|
66
|
+
# otherwise the generated SELECT (`SELECT FROM ...`) and INSERT
|
|
67
|
+
# (`INSERT INTO t () ...`) are syntactically broken. Checked here, after
|
|
68
|
+
# rejection, so it catches both a genuinely empty `columns: []` and a list
|
|
69
|
+
# left empty because every column was ignore:true. Schema generation does
|
|
70
|
+
# not call this method, so regenerating a broken config still works.
|
|
71
|
+
if !rails_managed? && !ignore && columns.empty?
|
|
72
|
+
raise ArgumentError,
|
|
73
|
+
"Table '#{name}' has no columns to extract " \
|
|
74
|
+
"(it may be empty in the config or have all columns set to ignore:true); " \
|
|
75
|
+
"define or unignore at least one column."
|
|
76
|
+
end
|
|
77
|
+
|
|
64
78
|
self
|
|
65
79
|
end
|
|
66
80
|
|
data/lib/exwiw/version.rb
CHANGED