Skip to content

Commit e5f60a4

Browse files
taglialamaxnovee
andauthored
Hotfix/22.3.1 (#977)
* Fix CI * Fix: `form_with` with `validate: false` exception on Rails 8 Ensure that super `form_with` is called with the right arguments. Fix #974 * Update changelog and version * Enable CI --------- Co-authored-by: Maksim <q@mnit.ee>
1 parent 1dc3ae7 commit e5f60a4

File tree

14 files changed

+29
-13
lines changed

14 files changed

+29
-13
lines changed

.github/workflows/eslint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: ESLint
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ 22-stable ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ 22-stable ]
88

99
permissions:
1010
contents: read

.github/workflows/javascript.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: JavaScript tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ 22-stable ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ 22-stable ]
88

99
permissions:
1010
contents: read

.github/workflows/rubocop.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Rubocop
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ 22-stable ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ 22-stable ]
88

99
permissions:
1010
contents: read

.github/workflows/ruby.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Ruby tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ 22-stable ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ 22-stable ]
88

99
permissions:
1010
contents: read

Appraisals

+2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
appraise 'rails-6.1' do
44
gem 'rails', '~> 6.1.0'
55
gem 'sqlite3', '~> 1.7'
6+
gem 'concurrent-ruby', '< 1.3.5' # Ref: rails/rails#54260
67
end
78

89
appraise 'rails-7.0' do
910
gem 'rails', '~> 7.0.0'
1011
gem 'sqlite3', '~> 1.7'
12+
gem 'concurrent-ruby', '< 1.3.5' # Ref: rails/rails#54260
1113
end
1214

1315
appraise 'rails-7.1' do

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 22.3.1 / 2025-01-29
4+
5+
* [BUGFIX] `form_with` default argument exception on Rails 8.0 ([#974](https://github.com/DavyJonesLocker/client_side_validations/issues/974))
6+
37
## 22.3.0 / 2024-11-12
48

59
* [FEATURE] Rails 8.0 compatibility

dist/client-side-validations.esm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* Client Side Validations JS - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations)
3-
* Copyright (c) 2024 Geremia Taglialatela, Brian Cardarella
3+
* Copyright (c) 2025 Geremia Taglialatela, Brian Cardarella
44
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
55
*/
66

dist/client-side-validations.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* Client Side Validations JS - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations)
3-
* Copyright (c) 2024 Geremia Taglialatela, Brian Cardarella
3+
* Copyright (c) 2025 Geremia Taglialatela, Brian Cardarella
44
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
55
*/
66

gemfiles/rails_6.1.gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ gem "sinatra"
2121
gem "sqlite3", "~> 1.7"
2222
gem "webrick"
2323
gem "rails", "~> 6.1.0"
24+
gem "concurrent-ruby", "< 1.3.5"
2425

2526
gemspec path: "../"

gemfiles/rails_7.0.gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ gem "sinatra"
2121
gem "sqlite3", "~> 1.7"
2222
gem "webrick"
2323
gem "rails", "~> 7.0.0"
24+
gem "concurrent-ruby", "< 1.3.5"
2425

2526
gemspec path: "../"

lib/client_side_validations/action_view/form_with_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module ClientSideValidations
44
module ActionView
55
module Helpers
66
module FormHelper
7-
def form_with(model: nil, scope: nil, url: nil, format: nil, **options, &block)
7+
def form_with(model: false, scope: nil, url: nil, format: nil, **options, &block)
88
return super unless options[:validate]
99

1010
options[:allow_method_names_outside_object] = true
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module ClientSideValidations
4-
VERSION = '22.3.0'
4+
VERSION = '22.3.1'
55
end

test/action_view/cases/test_form_with_helpers.rb

+8
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ def test_form_with_automatically_generate_ids
6767
assert_dom_equal expected, output_buffer
6868
end
6969

70+
def test_form_with_skip_validate
71+
assert_nothing_raised do
72+
form_with(validate: false)
73+
end
74+
75+
assert_dom 'form'
76+
end
77+
7078
BASE_FIELD_HELPERS.each do |field_helper, options|
7179
define_method(:"test_form_with_#{field_helper}") do
7280
form_with(model: @post, validate: true) do |f|

vendor/assets/javascripts/rails.validations.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* Client Side Validations JS - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations)
3-
* Copyright (c) 2024 Geremia Taglialatela, Brian Cardarella
3+
* Copyright (c) 2025 Geremia Taglialatela, Brian Cardarella
44
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
55
*/
66

0 commit comments

Comments
 (0)