declare_schema 1.5.0.pre.1 → 2.0.0

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: 9389b7ee742afb3976a2eb8468ab59f37782cdf1b60c75e64e0cd999aa12ae8b
4
- data.tar.gz: 778b052b3107291f4305af5eb62798d5a3f30d931a936fdaa957f8016871d1a9
3
+ metadata.gz: 92f1ec3624f575f6cbf8fb884b726c2957661f3d77078a467ca78e42dd95bdb2
4
+ data.tar.gz: 8735c888f46d675e49d06e56a37629e9cdf633218ce956ab111defc00013971f
5
5
  SHA512:
6
- metadata.gz: 53d80c7f261bf5e646478556ae721ee6beecf8aa98446e768292aac9f6a53ec5f3270f580095aadacc8aa7a3ad60510e9589cc2dafb6756ee14770c0a86df113
7
- data.tar.gz: dcd96a0d62da5dc3ffc4a2f48443b93b8991053fedd3a179ba6953f08b2801c649ffc893915a7fa77c75d1ffb74f8f5b468094f6e0c645b86a92dd91caaddd75
6
+ metadata.gz: c874389f98b8b7e6a5128a97324ad3a00597dc0892673f6d13c7b95611bb286d64afc40bee89cf992f71ba998a67fcd366ee2bd3527b71eb4113df8514ffe00d
7
+ data.tar.gz: 2a815e79364ae5eeb718488fa246adbf0730f0d9c4d92db802eedc2b9795c95a4061ca1d2a07014104a83f50a1dd6befb65ae49990e09f42e05a7b7e64fc0849
data/CHANGELOG.md CHANGED
@@ -4,10 +4,12 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
5
  Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [1.5.0] - Unreleased
7
+ ## [2.0.0] - 2024-05-14
8
8
  ### Added
9
9
  - Added support for Rails 7.0 and 7.1
10
10
  - Add support for automatic enum scopes for each value in the `:limit` array
11
+ ### Removed
12
+ - Removed support for Rails < 6.0
11
13
 
12
14
  ## [1.4.0] - 2024-01-24
13
15
  ### Added
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- declare_schema (1.5.0.pre.1)
5
- rails (>= 5.0)
4
+ declare_schema (2.0.0)
5
+ rails (>= 6.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -21,5 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.required_rubygems_version = ">= 1.3.6"
22
22
  s.require_paths = ["lib"]
23
23
 
24
- s.add_dependency 'rails', '>= 5.0'
24
+ s.add_dependency 'rails', '>= 6.0'
25
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeclareSchema
4
- VERSION = "1.5.0.pre.1"
4
+ VERSION = "2.0.0"
5
5
  end
@@ -113,10 +113,8 @@ module DeclareSchema
113
113
  ActiveRecord::Base.connection.schema_migration,
114
114
  ActiveRecord::Base.connection.internal_metadata
115
115
  ).migrations
116
- elsif ActiveSupport.version >= Gem::Version.new('6.0.0')
116
+ else
117
117
  ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths, ActiveRecord::SchemaMigration).migrations
118
- else # Rails 5.2 and earlier
119
- ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths).migrations
120
118
  end
121
119
  end
122
120
 
@@ -129,10 +127,8 @@ module DeclareSchema
129
127
  ActiveRecord::Base.connection.schema_migration,
130
128
  ActiveRecord::Base.connection.internal_metadata
131
129
  ).pending_migrations
132
- elsif ActiveSupport.version >= Gem::Version.new('6.0.0')
130
+ else
133
131
  ActiveRecord::Migrator.new(:up, migrations, ActiveRecord::SchemaMigration).pending_migrations
134
- else # Rails 5.2 and earlier
135
- ActiveRecord::Migrator.new(:up, migrations).pending_migrations
136
132
  end
137
133
  end
138
134
 
@@ -39,10 +39,6 @@ RSpec.describe 'DeclareSchema API' do
39
39
 
40
40
  load_models
41
41
 
42
- if ActiveSupport::VERSION::MAJOR == 5
43
- generate_migrations '-n', '-m'
44
- end
45
-
46
42
  require 'advert'
47
43
  Advert.reset_primary_key
48
44
 
@@ -19,77 +19,37 @@ RSpec.describe 'DeclareSchema Migration Generator' do
19
19
  end
20
20
  EOS
21
21
 
22
- if ActiveSupport::VERSION::MAJOR >= 7
23
- expect_model_definition_to_eq('alpha', <<~EOS)
24
- module Alpha
25
- def self.table_name_prefix
26
- "alpha_"
27
- end
22
+ expect_model_definition_to_eq('alpha', <<~EOS)
23
+ module Alpha
24
+ def self.table_name_prefix
25
+ #{ActiveSupport::VERSION::MAJOR >= 7 ? '"alpha_"' : "'alpha_'"}
28
26
  end
29
- EOS
30
- else
31
- expect_model_definition_to_eq('alpha', <<~EOS)
32
- module Alpha
33
- def self.table_name_prefix
34
- 'alpha_'
35
- end
36
- end
37
- EOS
38
- end
27
+ end
28
+ EOS
39
29
 
40
- case ActiveSupport::VERSION::MAJOR
41
- when 5
42
- expect_test_definition_to_eq('alpha/beta', <<~EOS)
43
- require "test_helper"
30
+ expect_test_definition_to_eq('alpha/beta', <<~EOS)
31
+ require "test_helper"
44
32
 
45
- class Alpha::BetaTest < ActiveSupport::TestCase
46
- # test "the truth" do
47
- # assert true
48
- # end
49
- end
50
- EOS
51
- else
52
- expect_test_definition_to_eq('alpha/beta', <<~EOS)
53
- require "test_helper"
54
-
55
- class Alpha::BetaTest < ActiveSupport::TestCase
56
- # test "the truth" do
57
- # assert true
58
- # end
59
- end
60
- EOS
61
- end
33
+ class Alpha::BetaTest < ActiveSupport::TestCase
34
+ # test "the truth" do
35
+ # assert true
36
+ # end
37
+ end
38
+ EOS
62
39
 
63
- case ActiveSupport::VERSION::MAJOR
64
- when 5
65
- expect_test_fixture_to_eq('alpha/beta', <<~EOS)
66
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
67
-
68
- # This model initially had no columns defined. If you add columns to the
69
- # model remove the '{}' from the fixture names and add the columns immediately
70
- # below each fixture, per the syntax in the comments below
71
- #
72
- one: {}
73
- # column: value
74
- #
75
- two: {}
76
- # column: value
77
- EOS
78
- when 6
79
- expect_test_fixture_to_eq('alpha/beta', <<~EOS)
80
- # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
81
-
82
- # This model initially had no columns defined. If you add columns to the
83
- # model remove the '{}' from the fixture names and add the columns immediately
84
- # below each fixture, per the syntax in the comments below
85
- #
86
- one: {}
87
- # column: value
88
- #
89
- two: {}
90
- # column: value
91
- EOS
92
- end
40
+ expect_test_fixture_to_eq('alpha/beta', <<~EOS)
41
+ # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
42
+
43
+ # This model initially had no columns defined. If you add columns to the
44
+ # model remove the #{ActiveSupport::VERSION::MAJOR >= 7 ? '"{}"' : "'{}'"} from the fixture names and add the columns immediately
45
+ # below each fixture, per the syntax in the comments below
46
+ #
47
+ one: {}
48
+ # column: value
49
+ #
50
+ two: {}
51
+ # column: value
52
+ EOS
93
53
 
94
54
  $LOAD_PATH << "#{TESTAPP_PATH}/app/models"
95
55
 
@@ -38,12 +38,7 @@ RSpec.describe 'DeclareSchema Migration Generator' do
38
38
  end
39
39
  let(:table_options) do
40
40
  if defined?(Mysql2)
41
- ", options: \"#{'ENGINE=InnoDB ' if ActiveSupport::VERSION::MAJOR == 5}DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\"" +
42
- if ActiveSupport::VERSION::MAJOR >= 6
43
- ', charset: "utf8mb4", collation: "utf8mb4_bin"'
44
- else
45
- ''
46
- end
41
+ ', options: "DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", charset: "utf8mb4", collation: "utf8mb4_bin"'
47
42
  else
48
43
  ", id: :integer"
49
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: declare_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0.pre.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca Development adapted from hobo_fields by Tom Locke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-12 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '6.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: '6.0'
27
27
  description: Declare your Rails/active_record model schemas and have database migrations
28
28
  generated for you!
29
29
  email: development@invoca.com