Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Rails 7.2, drop Ruby 3.0 and Rails 6.1 #54

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Build

on:
push:
branches: [master]
pull_request:

jobs:
Expand All @@ -11,15 +12,15 @@ jobs:

strategy:
matrix:
ruby-version: ["3.0", "3.1", "3.2"]
ruby-version: ["3.1", "3.2", "3.3"]
database:
- sqlite
- postgresql
- mysql
gemfile:
- Gemfile
- spec/ci/rails71.gemfile
- spec/ci/rails70.gemfile
- spec/ci/rails61.gemfile

services:
postgresql:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2
3.3.5
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ version 0.3.0.

validates_by_schema uses semantic versioning.

## 0.5.2 - 2024-10-29

- Add support for Rails 7.2, drop Ruby 3.0 and Rails 6.1

## 0.5.1 - 2023-02-28

- Improve load time to configure validations.
Expand Down
100 changes: 52 additions & 48 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,75 +1,77 @@
PATH
remote: .
specs:
validates_by_schema (0.5.1)
validates_by_schema (0.5.2)
activerecord (>= 6.0.0)

GEM
remote: https://rubygems.org/
specs:
actionpack (7.1.3.4)
actionview (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionpack (7.2.1.2)
actionview (= 7.2.1.2)
activesupport (= 7.2.1.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actionview (7.1.3.4)
activesupport (= 7.1.3.4)
useragent (~> 0.16)
actionview (7.2.1.2)
activesupport (= 7.2.1.2)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
activemodel (7.2.1.2)
activesupport (= 7.2.1.2)
activerecord (7.2.1.2)
activemodel (= 7.2.1.2)
activesupport (= 7.2.1.2)
timeout (>= 0.4.0)
activesupport (7.1.3.4)
activesupport (7.2.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
base64 (0.2.0)
bigdecimal (3.1.8)
builder (3.2.4)
concurrent-ruby (1.3.1)
builder (3.3.0)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crass (1.0.6)
diff-lcs (1.5.1)
docile (1.4.0)
docile (1.4.1)
drb (2.2.1)
erubi (1.12.0)
i18n (1.14.5)
erubi (1.13.0)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.13.1)
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
loofah (2.22.0)
logger (1.6.1)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mini_portile2 (2.8.7)
minitest (5.23.1)
mutex_m (0.2.0)
minitest (5.25.1)
mysql2 (0.5.6)
nokogiri (1.16.5)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
pg (1.5.6)
pg (1.5.9)
psych (5.1.2)
stringio
racc (1.8.0)
rack (3.0.11)
racc (1.8.1)
rack (3.1.8)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
Expand All @@ -84,54 +86,56 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
irb
railties (7.2.1.2)
actionpack (= 7.2.1.2)
activesupport (= 7.2.1.2)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rake (13.2.1)
rdoc (6.6.3.1)
rdoc (6.7.0)
psych (>= 4.0.0)
reline (0.5.7)
reline (0.5.10)
io-console (~> 0.5)
rspec-core (3.13.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (6.1.2)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
rspec-rails (7.0.1)
actionpack (>= 7.0)
activesupport (>= 7.0)
railties (>= 7.0)
rspec-core (~> 3.13)
rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
shoulda-matchers (6.2.0)
securerandom (0.3.1)
shoulda-matchers (6.4.0)
activesupport (>= 5.2.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov-html (0.13.1)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.4)
sqlite3 (1.7.3)
mini_portile2 (~> 2.8.0)
stringio (3.1.0)
thor (1.3.1)
stringio (3.1.1)
thor (1.3.2)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
webrick (1.8.1)
zeitwerk (2.6.13)
useragent (0.16.10)
webrick (1.8.2)
zeitwerk (2.6.18)

PLATFORMS
ruby
Expand Down
3 changes: 3 additions & 0 deletions lib/validates_by_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def validates_by_schema(options = {})

def load_schema!
super
# Set flag here to avoid infinite recursion
@schema_loaded = true

# define schema validations lazy to avoid accessing the database
# at class load time.
define_schema_validations
Expand Down
2 changes: 1 addition & 1 deletion lib/validates_by_schema/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ValidatesBySchema
VERSION = '0.5.1'
VERSION = '0.5.2'
end
2 changes: 1 addition & 1 deletion spec/ci/rails61.gemfile → spec/ci/rails71.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ gemspec path: '../..'
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gem 'activerecord', '~> 6.1.0'
gem 'activerecord', '~> 7.1.0'
2 changes: 1 addition & 1 deletion spec/support/models/contraption.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'widget'

class Contraption < Widget
enum kind: %w(one other)
enum :kind, %w(one other)

validates_by_schema
end
Loading