Skip to content

Commit

Permalink
Merge pull request #947 from DavyJonesLocker/chore/updates
Browse files Browse the repository at this point in the history
Minor updates
  • Loading branch information
tagliala authored Sep 19, 2024
2 parents dfcd0b5 + 15f0bce commit 9700559
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 23 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## main / unreleased

* [ENHANCEMENT] Update QUnit to 2.22.0
* [ENHANCEMENT] Prefer `require_relative` for internal requires

## 22.2.0 / 2026-06-01

* [FEATURE] Allow Rails 8.0 alpha
Expand Down
12 changes: 6 additions & 6 deletions lib/client_side_validations.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

require 'client_side_validations/config'
require 'client_side_validations/active_model' if defined?(ActiveModel)
require 'client_side_validations/active_record' if defined?(ActiveRecord)
require 'client_side_validations/action_view' if defined?(ActionView)
require_relative 'client_side_validations/config'
require_relative 'client_side_validations/active_model' if defined?(ActiveModel)
require_relative 'client_side_validations/active_record' if defined?(ActiveRecord)
require_relative 'client_side_validations/action_view' if defined?(ActionView)

if defined?(Rails)
require 'client_side_validations/engine'
require 'client_side_validations/generators'
require_relative 'client_side_validations/engine'
require_relative 'client_side_validations/generators'
end
8 changes: 4 additions & 4 deletions lib/client_side_validations/action_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ module Helpers
end
end

require 'client_side_validations/core_ext'
require 'client_side_validations/action_view/form_helper'
require_relative 'core_ext'
require_relative 'action_view/form_helper'

if ActionView::Helpers::FormHelper.method_defined?(:form_with)
require 'client_side_validations/action_view/form_with_helper'
require_relative 'action_view/form_with_helper'
end

require 'client_side_validations/action_view/form_builder'
require_relative 'action_view/form_builder'

ActiveSupport.on_load(:action_view) { include ClientSideValidations::ActionView::Helpers::FormHelper }
ActionView::Helpers::FormBuilder.prepend ClientSideValidations::ActionView::Helpers::FormBuilder
6 changes: 3 additions & 3 deletions lib/client_side_validations/active_model.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

require 'client_side_validations/core_ext'
require 'client_side_validations/extender'
require 'client_side_validations/active_model/conditionals'
require_relative 'core_ext'
require_relative 'extender'
require_relative 'active_model/conditionals'

module ClientSideValidations
module ActiveModel
Expand Down
3 changes: 1 addition & 2 deletions lib/client_side_validations/active_record.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require 'client_side_validations/active_model'
require 'client_side_validations/extender'
require_relative 'active_model'

ActiveSupport.on_load(:active_record) { include ClientSideValidations::ActiveModel::Validations }

Expand Down
5 changes: 3 additions & 2 deletions lib/client_side_validations/core_ext.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'active_support/json'
require 'client_side_validations/core_ext/range'
require 'client_side_validations/core_ext/regexp'

require_relative 'core_ext/range'
require_relative 'core_ext/regexp'
2 changes: 1 addition & 1 deletion lib/client_side_validations/generators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def self.assets
end
end

require 'client_side_validations/generators/rails_validations'
require_relative 'generators/rails_validations'
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.2",
"chrome-launcher": "^1.1.2",
"puppeteer-core": "^23.2.0",
"rollup": "^4.21.1",
"puppeteer-core": "^23.4.0",
"rollup": "^4.22.0",
"rollup-plugin-copy": "^3.5.0",
"standard": "^17.1.0"
"standard": "^17.1.2"
},
"dependencies": {},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/javascript/public/test/validators/confirmation.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
QUnit.module('Confirmation options', {
beforeEach: function () {
$('#qunit-fixture')
.append('<input id="password" type="password" />')
.append('<input id="password" type="password" autocomplete="new-password" />')
.append('<input id="password_confirmation" type="password" />')
.append('<input id="username" type="text" />')
.append('<input id="username_confirmation" type="text" />')
Expand Down
2 changes: 1 addition & 1 deletion test/javascript/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def call(env)
use AssetPath, urls: ['/vendor/assets/javascripts'], root: File.expand_path('../', $LOAD_PATH.find { |p| p.include?('jquery-rails') })

DEFAULT_JQUERY_VERSION = '3.7.1'
QUNIT_VERSION = '2.21.0'
QUNIT_VERSION = '2.22.0'

helpers do
def jquery_version
Expand Down

0 comments on commit 9700559

Please sign in to comment.