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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 804455ef32d0df5db5ae939d4befba9d21061b9f98b2dc1b4056ebcf989ea5db
4
- data.tar.gz: 3038b88a8f99c8ee6e5769b05c952151260bc80b477ea9db88ed26b95a0bf310
3
+ metadata.gz: 3e7ffd4903bd21ff3f946268281bcbe36c1e2bab867e97d855fa427b32b60511
4
+ data.tar.gz: 16dd1ef6d5dcba5726a9bd82fc2b0ffaec7279a2cb64c8b7fadb3d19b026c9b3
5
5
  SHA512:
6
- metadata.gz: 3a54ffcae9908f895e22ed264e7efcf80f9c8694c75ad98e583f84589187499713958905f21fb86dc336fc11aadafa2ed296e87c754e123fc2c9da8762dbf42d
7
- data.tar.gz: 387656485eb61c0963abcdae0079a7894f28923954c2544731e170795767408881d533b820df7d746dab96b54064c66ce618635e0a0b292fb49fa1a05ca84eb2
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
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Kirei
5
- VERSION = "0.6.1"
5
+ VERSION = "0.6.2"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kirei
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ludwig Reinmiedl