Skip to content

Commit

Permalink
Hotfix/22.3.1 (#977)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
tagliala and maxnovee authored Jan 29, 2025
1 parent 1dc3ae7 commit e5f60a4
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: ESLint

on:
push:
branches: [ main ]
branches: [ 22-stable ]
pull_request:
branches: [ main ]
branches: [ 22-stable ]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: JavaScript tests

on:
push:
branches: [ main ]
branches: [ 22-stable ]
pull_request:
branches: [ main ]
branches: [ 22-stable ]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Rubocop

on:
push:
branches: [ main ]
branches: [ 22-stable ]
pull_request:
branches: [ main ]
branches: [ 22-stable ]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Ruby tests

on:
push:
branches: [ main ]
branches: [ 22-stable ]
pull_request:
branches: [ main ]
branches: [ 22-stable ]

permissions:
contents: read
Expand Down
2 changes: 2 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
gem 'sqlite3', '~> 1.7'
gem 'concurrent-ruby', '< 1.3.5' # Ref: rails/rails#54260
end

appraise 'rails-7.0' do
gem 'rails', '~> 7.0.0'
gem 'sqlite3', '~> 1.7'
gem 'concurrent-ruby', '< 1.3.5' # Ref: rails/rails#54260
end

appraise 'rails-7.1' do
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 22.3.1 / 2025-01-29

* [BUGFIX] `form_with` default argument exception on Rails 8.0 ([#974](https://github.com/DavyJonesLocker/client_side_validations/issues/974))

## 22.3.0 / 2024-11-12

* [FEATURE] Rails 8.0 compatibility
Expand Down
2 changes: 1 addition & 1 deletion dist/client-side-validations.esm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Client Side Validations JS - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations)
* Copyright (c) 2024 Geremia Taglialatela, Brian Cardarella
* Copyright (c) 2025 Geremia Taglialatela, Brian Cardarella
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
*/

Expand Down
2 changes: 1 addition & 1 deletion dist/client-side-validations.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Client Side Validations JS - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations)
* Copyright (c) 2024 Geremia Taglialatela, Brian Cardarella
* Copyright (c) 2025 Geremia Taglialatela, Brian Cardarella
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
*/

Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ gem "sinatra"
gem "sqlite3", "~> 1.7"
gem "webrick"
gem "rails", "~> 6.1.0"
gem "concurrent-ruby", "< 1.3.5"

gemspec path: "../"
1 change: 1 addition & 0 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ gem "sinatra"
gem "sqlite3", "~> 1.7"
gem "webrick"
gem "rails", "~> 7.0.0"
gem "concurrent-ruby", "< 1.3.5"

gemspec path: "../"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module ClientSideValidations
module ActionView
module Helpers
module FormHelper
def form_with(model: nil, scope: nil, url: nil, format: nil, **options, &block)
def form_with(model: false, scope: nil, url: nil, format: nil, **options, &block)
return super unless options[:validate]

options[:allow_method_names_outside_object] = true
Expand Down
2 changes: 1 addition & 1 deletion lib/client_side_validations/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ClientSideValidations
VERSION = '22.3.0'
VERSION = '22.3.1'
end
8 changes: 8 additions & 0 deletions test/action_view/cases/test_form_with_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ def test_form_with_automatically_generate_ids
assert_dom_equal expected, output_buffer
end

def test_form_with_skip_validate
assert_nothing_raised do
form_with(validate: false)
end

assert_dom 'form'
end

BASE_FIELD_HELPERS.each do |field_helper, options|
define_method(:"test_form_with_#{field_helper}") do
form_with(model: @post, validate: true) do |f|
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/rails.validations.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Client Side Validations JS - v0.4.0 (https://github.com/DavyJonesLocker/client_side_validations)
* Copyright (c) 2024 Geremia Taglialatela, Brian Cardarella
* Copyright (c) 2025 Geremia Taglialatela, Brian Cardarella
* Licensed under MIT (https://opensource.org/licenses/mit-license.php)
*/

Expand Down

0 comments on commit e5f60a4

Please sign in to comment.