kirei 0.6.0 → 0.6.2
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/cli/commands/new_app/files/db_rake.rb +3 -1
- data/lib/kirei/routing/base.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/routing/base.rb
CHANGED
@@ -162,7 +162,9 @@ module Kirei
|
|
162
162
|
|
163
163
|
sig { params(headers: T::Hash[String, String], env: RackEnvType).void }
|
164
164
|
def add_cors_headers(headers, env)
|
165
|
-
origin = T.cast(env.fetch("HTTP_ORIGIN"), String)
|
165
|
+
origin = T.cast(env.fetch("HTTP_ORIGIN", nil), T.nilable(String))
|
166
|
+
return if origin.nil?
|
167
|
+
|
166
168
|
allowed_origins = Kirei::App.config.allowed_origins
|
167
169
|
return unless allowed_origins.include?(origin)
|
168
170
|
|
data/lib/kirei/version.rb
CHANGED