declare_schema 2.3.1 → 2.3.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: 32cd73e09d5530729bfef42e4277d229d3688c826a8f8c28575175508fe023ee
4
- data.tar.gz: 8ce537e1883effbb466242547580c2de3db9ca87064b1ae6a778a3422a3e5f61
3
+ metadata.gz: b38ba5f14cb9ff014da1baaf10698db6e1ad744aa50804e62c2a958d75f26c47
4
+ data.tar.gz: 526ab470daae916fcb233fa397d385feef77b7933237219e733db1543bef7184
5
5
  SHA512:
6
- metadata.gz: 51a55ba1f327ba291d5b0efece8fa168520ebfd91cd984dad9a4a36cb6b9abfa03379563ff170969124d31e09fd908e2de29c3cb0f9ae8ee4fa840a11c0d3e03
7
- data.tar.gz: f869a73076a408d5b229d125f59d64af06fc7d1908f6e139fd1a032559a9f6e9476ec3bef93bab43190e264f1f05e35e310c390c14eb990b541ee7944c7d5612
6
+ metadata.gz: 18768edfdc06e9562246243d1d91e698545f0dfceefbcd48a29894733a684493e2c521cc782bbd45767d0980479c17657a12bc7ec25242d594ac4851b62925c5
7
+ data.tar.gz: 760e5374a42726af4a3eb04f3c6063c1266d3384a5c23082d671b0485ce341b58c0ac5cf6726a49b5ddeb73d01cccd8213e81ea64eee1ac19fa219b3bdefb961
@@ -4,39 +4,25 @@ on: [push]
4
4
  name: DeclareSchema Build
5
5
 
6
6
  jobs:
7
- build:
7
+ tests:
8
8
  name: DeclareSchema Build
9
9
  runs-on: ubuntu-latest
10
10
  strategy:
11
11
  fail-fast: false
12
12
  matrix:
13
13
  adapter: [mysql, postgresql, sqlite3]
14
- ruby: ['3.0', 3.1, 3.2, 3.3]
14
+ ruby: [3.1, 3.2, 3.3, 3.4]
15
15
  gemfile:
16
- - gemfiles/rails_6_1.gemfile
17
16
  - gemfiles/rails_7_0.gemfile
18
17
  - gemfiles/rails_7_1.gemfile
19
18
  - gemfiles/rails_7_2.gemfile
19
+ - gemfiles/rails_8_0.gemfile
20
20
  exclude:
21
- - adapter: mysql
22
- ruby: 3.3
23
- gemfile: gemfiles/rails_6_1.gemfile
24
- - adapter: postgresql
25
- ruby: 3.3
26
- gemfile: gemfiles/rails_6_1.gemfile
21
+ - ruby: 3.1
22
+ gemfile: gemfiles/rails_8_0.gemfile
23
+ # TODO: Support SQLite3 with Rails 8.0
27
24
  - adapter: sqlite3
28
- ruby: 3.3
29
- gemfile: gemfiles/rails_6_1.gemfile
30
- - adapter: mysql
31
- ruby: '3.0'
32
- gemfile: gemfiles/rails_7_2.gemfile
33
- - adapter: postgresql
34
- ruby: '3.0'
35
- gemfile: gemfiles/rails_7_2.gemfile
36
- - adapter: sqlite3
37
- ruby: '3.0'
38
- gemfile: gemfiles/rails_7_2.gemfile
39
-
25
+ gemfile: gemfiles/rails_8_0.gemfile
40
26
  env:
41
27
  BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
42
28
  MYSQL_HOST: 127.0.0.1
data/Appraisals CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'json'
4
4
  require 'open-uri'
5
5
 
6
- MIN_RAILS_VERSION = Gem::Version.new('6.1.0')
6
+ MIN_RAILS_VERSION = Gem::Version.new('7.0.0')
7
7
 
8
8
  rails_versions_to_test = Set.new
9
9
 
data/CHANGELOG.md CHANGED
@@ -4,7 +4,11 @@ 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
- ## [2.3.1] - Unreleased
7
+ ## [2.3.2] - 2025-02-21
8
+ ### Fixed
9
+ - Removed require of `activesupport/proxy_object` which is removed in Rails 8.0
10
+
11
+ ## [2.3.1] - 2024-12-10
8
12
  ### Fixed
9
13
  - Fixed bug where a new model with `belongs_to :owner, polymorphic: true` would cause
10
14
  a "Mysql2::Error: Table '<new table>' doesn't exist:" exception when generating a migration.
data/Gemfile CHANGED
@@ -26,3 +26,10 @@ gem 'yard'
26
26
  gem 'mysql2', '~> 0.5'
27
27
  gem 'pg', '~> 1.1'
28
28
  gem 'sqlite3', '~> 1.4'
29
+
30
+
31
+ gem "concurrent-ruby", "~> 1.3", "< 1.3.5"
32
+
33
+ gem "base64", ">= 0.2.0"
34
+ gem "bigdecimal", ">= 3.1"
35
+ gem "mutex_m", ">= 0.3.0"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- declare_schema (2.3.1)
4
+ declare_schema (2.3.2)
5
5
  rails (>= 6.0)
6
6
 
7
7
  GEM
@@ -71,6 +71,8 @@ GEM
71
71
  rake
72
72
  thor (>= 0.14.0)
73
73
  ast (2.4.2)
74
+ base64 (0.2.0)
75
+ bigdecimal (3.1.9)
74
76
  bootsnap (1.18.4)
75
77
  msgpack (~> 1.2)
76
78
  builder (3.3.0)
@@ -106,6 +108,7 @@ GEM
106
108
  mini_portile2 (2.8.7)
107
109
  minitest (5.25.0)
108
110
  msgpack (1.7.2)
111
+ mutex_m (0.3.0)
109
112
  mysql2 (0.5.6)
110
113
  net-imap (0.4.14)
111
114
  date
@@ -228,11 +231,15 @@ PLATFORMS
228
231
 
229
232
  DEPENDENCIES
230
233
  appraisal
234
+ base64 (>= 0.2.0)
235
+ bigdecimal (>= 3.1)
231
236
  bootsnap (>= 1.1.0)
232
237
  climate_control (~> 0.2)
238
+ concurrent-ruby (~> 1.3, < 1.3.5)
233
239
  declare_schema!
234
240
  listen
235
241
  mail
242
+ mutex_m (>= 0.3.0)
236
243
  mysql2 (~> 0.5)
237
244
  net-smtp
238
245
  pg (~> 1.1)
data/catalog-info.yaml CHANGED
@@ -26,6 +26,8 @@ metadata:
26
26
  - open-source
27
27
  - gem
28
28
  - executable
29
+ - public
30
+ - rails-dependent
29
31
  description: Declare your Rails/active_record model schemas and have database migrations
30
32
  generated for you!
31
33
  spec:
@@ -17,6 +17,10 @@ gem "yard"
17
17
  gem "mysql2", "~> 0.5"
18
18
  gem "pg", "~> 1.1"
19
19
  gem "sqlite3", "~> 1.4"
20
+ gem "concurrent-ruby", "~> 1.3", "< 1.3.5"
21
+ gem "base64", ">= 0.2.0"
22
+ gem "bigdecimal", ">= 3.1"
23
+ gem "mutex_m", ">= 0.3.0"
20
24
 
21
25
  group :testapp do
22
26
  gem "bootsnap", ">= 1.1.0", require: false
@@ -17,6 +17,10 @@ gem "yard"
17
17
  gem "mysql2", "~> 0.5"
18
18
  gem "pg", "~> 1.1"
19
19
  gem "sqlite3", "~> 1.4"
20
+ gem "concurrent-ruby", "~> 1.3", "< 1.3.5"
21
+ gem "base64", ">= 0.2.0"
22
+ gem "bigdecimal", ">= 3.1"
23
+ gem "mutex_m", ">= 0.3.0"
20
24
 
21
25
  group :testapp do
22
26
  gem "bootsnap", ">= 1.1.0", require: false
@@ -17,6 +17,10 @@ gem "yard"
17
17
  gem "mysql2", "~> 0.5"
18
18
  gem "pg", "~> 1.1"
19
19
  gem "sqlite3", "~> 1.4"
20
+ gem "concurrent-ruby", "~> 1.3", "< 1.3.5"
21
+ gem "base64", ">= 0.2.0"
22
+ gem "bigdecimal", ">= 3.1"
23
+ gem "mutex_m", ">= 0.3.0"
20
24
 
21
25
  group :testapp do
22
26
  gem "bootsnap", ">= 1.1.0", require: false
@@ -8,7 +8,7 @@ gem "mail"
8
8
  gem "net-smtp"
9
9
  gem "pry"
10
10
  gem "pry-byebug"
11
- gem "rails", "~> 6.1.0"
11
+ gem "rails", "~> 8.0.0"
12
12
  gem "responders"
13
13
  gem "rspec"
14
14
  gem "rspec-its"
@@ -17,6 +17,10 @@ gem "yard"
17
17
  gem "mysql2", "~> 0.5"
18
18
  gem "pg", "~> 1.1"
19
19
  gem "sqlite3", "~> 1.4"
20
+ gem "concurrent-ruby", "~> 1.3", "< 1.3.5"
21
+ gem "base64", ">= 0.2.0"
22
+ gem "bigdecimal", ">= 3.1"
23
+ gem "mutex_m", ">= 0.3.0"
20
24
 
21
25
  group :testapp do
22
26
  gem "bootsnap", ">= 1.1.0", require: false
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/proxy_object'
4
-
5
3
  module DeclareSchema
6
4
  class Dsl < BasicObject # avoid Object because that gets extended by lots of gems
7
5
  include ::Kernel # but we need the basic class methods
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/proxy_object'
4
-
5
3
  module DeclareSchema
6
4
  class FieldDeclarationDsl < BasicObject # avoid Object because that gets extended by lots of gems
7
5
  include ::Kernel # but we need the basic class methods
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeclareSchema
4
- VERSION = "2.3.1"
4
+ VERSION = "2.3.2"
5
5
  end
@@ -899,7 +899,12 @@ RSpec.describe 'DeclareSchema Migration Generator' do
899
899
  end
900
900
  up, _down = Generators::DeclareSchema::Migration::Migrator.run
901
901
  ActiveRecord::Migration.class_eval(up)
902
- expect(Ad.field_specs['company'].options[:validates].inspect).to eq("{:presence=>true, :uniqueness=>{:case_sensitive=>false}}")
902
+
903
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.4")
904
+ expect(Ad.field_specs['company'].options[:validates].inspect).to eq("{:presence=>true, :uniqueness=>{:case_sensitive=>false}}")
905
+ else
906
+ expect(Ad.field_specs['company'].options[:validates].inspect).to eq("{presence: true, uniqueness: {case_sensitive: false}}")
907
+ end
903
908
 
904
909
  # DeclareSchema supports has_and_belongs_to_many relationships and generates the intersection ("join") table
905
910
  # with appropriate primary key, indexes, and foreign keys.
@@ -24,7 +24,11 @@ RSpec.describe DeclareSchema::Model::TableOptionsDefinition do
24
24
 
25
25
  describe '#to_key' do
26
26
  subject { model.to_key }
27
- it { is_expected.to eq(['table_options_definition_test_models', "{:charset=>#{charset.inspect}, :collation=>#{collation.inspect}}"]) }
27
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.4")
28
+ it { is_expected.to eq(['table_options_definition_test_models', "{:charset=>#{charset.inspect}, :collation=>#{collation.inspect}}"]) }
29
+ else
30
+ it { is_expected.to eq(['table_options_definition_test_models', "{charset: #{charset.inspect}, collation: #{collation.inspect}}"]) }
31
+ end
28
32
  end
29
33
 
30
34
  describe '#settings' do
@@ -56,7 +60,11 @@ RSpec.describe DeclareSchema::Model::TableOptionsDefinition do
56
60
 
57
61
  describe '#hash' do
58
62
  subject { model.hash }
59
- it { is_expected.to eq(['table_options_definition_test_models', "{:charset=>#{charset.inspect}, :collation=>#{collation.inspect}}"].hash) }
63
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.4")
64
+ it { is_expected.to eq(['table_options_definition_test_models', "{:charset=>#{charset.inspect}, :collation=>#{collation.inspect}}"].hash) }
65
+ else
66
+ it { is_expected.to eq(['table_options_definition_test_models', "{charset: #{charset.inspect}, collation: #{collation.inspect}}"].hash) }
67
+ end
60
68
  end
61
69
 
62
70
  describe '#to_s' do
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: 2.3.1
4
+ version: 2.3.2
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-12-11 00:00:00.000000000 Z
11
+ date: 2025-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -37,8 +37,8 @@ files:
37
37
  - ".devcontainer/devcontainer.json"
38
38
  - ".devcontainer/docker-compose.yml"
39
39
  - ".github/CODEOWNERS"
40
- - ".github/workflows/declare_schema_build.yml"
41
40
  - ".github/workflows/gem_release.yml"
41
+ - ".github/workflows/pipeline.yml"
42
42
  - ".gitignore"
43
43
  - ".rspec"
44
44
  - ".rubocop.yml"
@@ -57,10 +57,10 @@ files:
57
57
  - config/brakeman.ignore
58
58
  - declare_schema.gemspec
59
59
  - gemfiles/.bundle/config
60
- - gemfiles/rails_6_1.gemfile
61
60
  - gemfiles/rails_7_0.gemfile
62
61
  - gemfiles/rails_7_1.gemfile
63
62
  - gemfiles/rails_7_2.gemfile
63
+ - gemfiles/rails_8_0.gemfile
64
64
  - lib/declare_schema.rb
65
65
  - lib/declare_schema/command.rb
66
66
  - lib/declare_schema/dsl.rb
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: 1.3.6
160
160
  requirements: []
161
- rubygems_version: 3.4.10
161
+ rubygems_version: 3.5.10
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Database schema declaration and migration generator for Rails