dynamic_migrations 3.2.0 → 3.2.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: '05957cccec4b1ee5138e9e74daa7714da41b99be958f7171e1c88475fe495e7b'
4
- data.tar.gz: fd7cb71f07ded6599286dac27c274832bf97de43e56b69a47b7238aefaac2cde
3
+ metadata.gz: e8f9a1a4cf3316579443b0fed7898a42ab410ba114d194c5ffb874a5ca5027d9
4
+ data.tar.gz: 03651b7187cef799edee4d64e9c7533f0c6fb9ce0f9193b16e721c13e508373b
5
5
  SHA512:
6
- metadata.gz: f1729685ce54c91e0a3a8ce03fbb552887450b843f4c654678717aba41c1e52b66dff1104b9acaedd955e221267619e64405fe4088af9de54b9216446bf87984
7
- data.tar.gz: 95668080a1d329fcaf0172e3593cfc59bab34b7edca05fedfe23d10d7b83945bd9c79943768765f505997fdd8781721569b2845d752d8f99450d251758d41eac
6
+ metadata.gz: cfdbf88d363b8280f18d1aa63cc7ad9d917de7d5c0582ae43a02ac9341af4c00918f6cd5382c935c2a1a1026873afdd98e2aed42397a722b8660fb876133408a
7
+ data.tar.gz: 35451e4c7cfbcfa0a7dec0133b726d005c32ff4c1d7d2792737f24b4b7c2da98b0ba50250f30876f99743d16b911201243d0a0252f162794ec6a08e1955cc634
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.2](https://github.com/craigulliott/dynamic_migrations/compare/v3.2.1...v3.2.2) (2023-08-17)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * automatically strip whitespace off validation check_clause ([f7a3b91](https://github.com/craigulliott/dynamic_migrations/commit/f7a3b91e694db83a5aefcd25e50985c05aaf97e2))
9
+
10
+ ## [3.2.1](https://github.com/craigulliott/dynamic_migrations/compare/v3.2.0...v3.2.1) (2023-08-17)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * making column descriptions optional ([c384225](https://github.com/craigulliott/dynamic_migrations/commit/c3842254841c677efb777a1beb519754a4e85cc1))
16
+ * trimming object descriptions when saving ([c384225](https://github.com/craigulliott/dynamic_migrations/commit/c3842254841c677efb777a1beb519754a4e85cc1))
17
+
3
18
  ## [3.2.0](https://github.com/craigulliott/dynamic_migrations/compare/v3.1.1...v3.2.0) (2023-08-16)
4
19
 
5
20
 
@@ -21,6 +21,15 @@ module DynamicMigrations
21
21
  options[:array] = true
22
22
  end
23
23
 
24
+ # comment has to be last
25
+ if column.description
26
+ options[:comment] = <<~RUBY
27
+ <<~COMMENT
28
+ #{indent column.description}
29
+ COMMENT
30
+ RUBY
31
+ end
32
+
24
33
  options_syntax = options.map { |k, v| "#{k}: #{v}" }.join(", ")
25
34
 
26
35
  data_type = column.data_type
@@ -34,9 +43,7 @@ module DynamicMigrations
34
43
  object: column,
35
44
  code_comment: code_comment,
36
45
  migration: <<~RUBY
37
- add_column :#{column.table.name}, :#{column.name}, :#{data_type}, #{options_syntax}, comment: <<~COMMENT
38
- #{indent column.description}
39
- COMMENT
46
+ add_column :#{column.table.name}, :#{column.name}, :#{data_type}, #{options_syntax}
40
47
  RUBY
41
48
  end
42
49
 
@@ -38,7 +38,8 @@ module DynamicMigrations
38
38
 
39
39
  unless description.nil?
40
40
  raise ExpectedStringError, description unless description.is_a? String
41
- @description = description
41
+ @description = description.strip
42
+ @description = nil if description == ""
42
43
  end
43
44
  end
44
45
 
@@ -34,7 +34,8 @@ module DynamicMigrations
34
34
 
35
35
  unless description.nil?
36
36
  raise ExpectedStringError, description unless description.is_a? String
37
- @description = description
37
+ @description = description.strip
38
+ @description = nil if description == ""
38
39
  end
39
40
 
40
41
  @interval_type = interval_type
@@ -72,7 +72,8 @@ module DynamicMigrations
72
72
 
73
73
  unless description.nil?
74
74
  raise ExpectedStringError, description unless description.is_a? String
75
- @description = description
75
+ @description = description.strip
76
+ @description = nil if description == ""
76
77
  end
77
78
 
78
79
  raise ExpectedBooleanError, deferrable unless [true, false].include?(deferrable)
@@ -61,7 +61,8 @@ module DynamicMigrations
61
61
 
62
62
  unless description.nil?
63
63
  raise ExpectedStringError, description unless description.is_a? String
64
- @description = description
64
+ @description = description.strip
65
+ @description = nil if description == ""
65
66
  end
66
67
 
67
68
  raise ExpectedBooleanError, unique unless [true, false].include?(unique)
@@ -45,7 +45,8 @@ module DynamicMigrations
45
45
 
46
46
  unless description.nil?
47
47
  raise ExpectedStringError, description unless description.is_a? String
48
- @description = description
48
+ @description = description.strip
49
+ @description = nil if description == ""
49
50
  end
50
51
  end
51
52
 
@@ -115,7 +115,8 @@ module DynamicMigrations
115
115
 
116
116
  unless description.nil?
117
117
  raise ExpectedStringError, description unless description.is_a? String
118
- @description = description
118
+ @description = description.strip
119
+ @description = nil if description == ""
119
120
  end
120
121
  end
121
122
 
@@ -50,7 +50,8 @@ module DynamicMigrations
50
50
 
51
51
  unless description.nil?
52
52
  raise ExpectedStringError, description unless description.is_a? String
53
- @description = description
53
+ @description = description.strip
54
+ @description = nil if description == ""
54
55
  end
55
56
 
56
57
  raise ExpectedBooleanError, deferrable unless [true, false].include?(deferrable)
@@ -44,11 +44,12 @@ module DynamicMigrations
44
44
  @name = name
45
45
 
46
46
  raise ExpectedStringError, check_clause unless check_clause.is_a? String
47
- @check_clause = check_clause
47
+ @check_clause = check_clause.strip
48
48
 
49
49
  unless description.nil?
50
50
  raise ExpectedStringError, description unless description.is_a? String
51
- @description = description
51
+ @description = description.strip
52
+ @description = nil if description == ""
52
53
  end
53
54
 
54
55
  raise ExpectedBooleanError, deferrable unless [true, false].include?(deferrable)
@@ -39,7 +39,8 @@ module DynamicMigrations
39
39
 
40
40
  unless description.nil?
41
41
  raise ExpectedStringError, description unless description.is_a? String
42
- @description = description
42
+ @description = description.strip
43
+ @description = nil if description == ""
43
44
  end
44
45
 
45
46
  @columns = {}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynamicMigrations
4
- VERSION = "3.2.0"
4
+ VERSION = "3.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-16 00:00:00.000000000 Z
11
+ date: 2023-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg