kirei 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cli/commands/new_app/files/db_rake.rb +3 -1
- data/lib/kirei/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: 3e7ffd4903bd21ff3f946268281bcbe36c1e2bab867e97d855fa427b32b60511
|
4
|
+
data.tar.gz: 16dd1ef6d5dcba5726a9bd82fc2b0ffaec7279a2cb64c8b7fadb3d19b026c9b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b90c57cf123fec1ab046acb8302aaeed6703804cb943042895dc67834c5c1fd6537529db447ff2afd0a63082746b8df7711e29bab6b9727ae9a6e00350b71710
|
7
|
+
data.tar.gz: 8ab4ea5001ab9a0e8c027496e820e09543bf92979c5c1f81978eb0fc97ff0645696d2838f1677ecdbe57a272f8d0cbcce838616f8e18a4807a4c12df7d1bf20f
|
@@ -175,6 +175,8 @@ module Cli
|
|
175
175
|
modules = model_file.gsub("app/models/", "").gsub(".rb", "").split("/").map { |mod| Zeitwerk::Inflector.new.camelize(mod, model_path) }
|
176
176
|
const_name = modules.join("::")
|
177
177
|
model_klass = Object.const_get(const_name)
|
178
|
+
next unless model_klass.ancestors.include?(Kirei::Model)
|
179
|
+
|
178
180
|
table_name = model_klass.table_name
|
179
181
|
schema = db.schema(table_name)
|
180
182
|
|
@@ -183,7 +185,7 @@ module Cli
|
|
183
185
|
file_contents = File.read(model_path)
|
184
186
|
|
185
187
|
# Remove existing schema info comments if present
|
186
|
-
updated_contents = file_contents.sub(/# == Schema Info\\n(.*?)(\\n#\\n)?\\n(?=\\s*class)/m, "")
|
188
|
+
updated_contents = file_contents.sub(/# == Schema Info\\n(.*?)(\\n#\\n)?\\n(?=\\s*(?:class|module))/m, "")
|
187
189
|
|
188
190
|
# Insert the new schema comments before the module/class definition
|
189
191
|
first_const = modules.first
|
data/lib/kirei/version.rb
CHANGED