generated_schema_validations 0.5.1 → 0.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5eb0b94787c5c2fa3dd63dfd3b0f60f15b4b109813ffcc9839bb28491eb11924
4
- data.tar.gz: 247d7ce6faf3829e0710ed5c6ed1d962b7ffc5e3e2b7baeb72b0b44d69f6887b
3
+ metadata.gz: fe8baf27b9a18a5f82773b9aaea380a777a0c04a8b6d1367dcec8460797bba07
4
+ data.tar.gz: 1c9dc3a8855e5643092d016e8adcf049abcc06433e9e5483fc6a4715e4b10fcb
5
5
  SHA512:
6
- metadata.gz: 8d7baeb772e414b39dd83be6e1bbd40af2494b227de222c6c3ed907ea5b2598d976cfde3c5f74df57280413366b3ec194f9b8324bba71ec772cead68e1b3c311
7
- data.tar.gz: 7d87b3e7dfe1392ff49871f362658abcf712484c7f89bacf0124d52cb5c06cf18196ea25a5649b9d70fccbdba9b69cc9a81587caab8a9abd7fda292292c31d35
6
+ metadata.gz: 49786698613eb20f5e25601f14cd40d339c53ddab70b67fec79990e1bf51d6370117ba7050c0db862c14c081e7d8dd9010ab96d9470cba316f8f83b1c1a2844e
7
+ data.tar.gz: 298bfe17880ec5b6682ea85ba6e47afa7baeca4f19127216ffaac998dabe7e394442212989452a6374a384e634df97332524ad2bd2a40369d37902d5bc8c1f14
data/README.md CHANGED
@@ -69,6 +69,14 @@ AllCops:
69
69
  - app/models/concerns/schema_validations.rb
70
70
  ```
71
71
 
72
+ ### Compare online database after deployment with capistrano
73
+
74
+ ```ruby
75
+ # Add to Capfile
76
+
77
+ require 'generated_schema_validations/capistrano_tasks'
78
+
79
+ ```
72
80
 
73
81
  ## Usage
74
82
 
@@ -97,6 +105,14 @@ You can watch changes on `schema_validations.rb` to understand the generated val
97
105
 
98
106
  ## Changelog
99
107
 
108
+ ### 0.5.3
109
+
110
+ * adds support for Rails 7.2
111
+
112
+ ### 0.5.2
113
+
114
+ * sort generated validates to ignore column order
115
+
100
116
  ### 0.5.1
101
117
 
102
118
  * raise info about where-unique conditions only in local envs
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'generated_schema_validations'
5
- spec.version = '0.5.1'
5
+ spec.version = '0.5.3'
6
6
  spec.authors = ['Georg Limbach']
7
7
  spec.email = ['georg.limbach@lichtbit.com']
8
8
 
@@ -3,7 +3,19 @@
3
3
  class GeneratedSchemaValidations::DumpChecker < GeneratedSchemaValidations::Dumper
4
4
  def self.read_schema_content
5
5
  stream = StringIO.new
6
- ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream)
6
+
7
+ if ActiveRecord::VERSION::STRING >= "7.2"
8
+ ActiveRecord::SchemaDumper.dump(
9
+ ActiveRecord::Base.connection_pool,
10
+ stream
11
+ )
12
+ else
13
+ ActiveRecord::SchemaDumper.dump(
14
+ ActiveRecord::Base.connection,
15
+ stream
16
+ )
17
+ end
18
+
7
19
  stream.rewind
8
20
  stream.read
9
21
  end
@@ -27,6 +27,12 @@ class GeneratedSchemaValidations::Table
27
27
  end
28
28
 
29
29
  def to_s
30
+ # sort everything
31
+ @possible_belongs_to_not_null_columns.sort!
32
+ @bad_indexes.sort!
33
+ @unique_indexes.sort!
34
+ @validations.sort_by!(&:to_s)
35
+
30
36
  string = "\n"
31
37
  string += "def dbv_#{table_name}_validations(enums: [])\n"
32
38
  if @possible_belongs_to_not_null_columns.present?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: generated_schema_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Georg Limbach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-04 00:00:00.000000000 Z
11
+ date: 2025-12-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: After each migration it generates a file with some validations. Each
14
14
  active record should include this file and can uns generated validations.