Skip to content

Commit a77535c

Browse files
committed
Add bigdecimal to runtime dependency
## Motivation / Background Follow up ruby/ruby@1c93288. This PR adds bigdecimal to runtime dependency of Active Support to suppress the following Ruby 3.3.0dev's warning. > /Users/koic/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/bundler/gems/rails-a8871e6829e5/activesupport/lib/ > active_support/core_ext/object/json.rb:5: warning: bigdecimal will be not part of the default gems since Ruby 3.4.0. > Add bigdecimal to your Gemfile. Also contact author of to add bigdecimal into its gemspec. The grep yields the following results: ```console $ git grep 'require.*bigdecimal' activejob/lib/active_job/arguments.rb:3:require "bigdecimal" activejob/lib/active_job/serializers/big_decimal_serializer.rb:3:require "bigdecimal" activejob/test/cases/argument_serialization_test.rb:3:require "bigdecimal" activemodel/lib/active_model/type/decimal.rb:3:require "bigdecimal/util" activemodel/lib/active_model/validations/numericality.rb:5:require "bigdecimal/util" activemodel/test/cases/validations/numericality_validation_test.rb:8:require "bigdecimal" activerecord/test/cases/adapters/sqlite3/quoting_test.rb:4:require "bigdecimal" activerecord/test/cases/arel/visitors/to_sql_test.rb:4:require "bigdecimal" activerecord/test/cases/migration_test.rb:5:require "bigdecimal/util" activesupport/lib/active_support/core_ext/big_decimal/conversions.rb:3:require "bigdecimal" activesupport/lib/active_support/core_ext/big_decimal/conversions.rb:4:require "bigdecimal/util" activesupport/lib/active_support/core_ext/object/json.rb:5:require "bigdecimal" activesupport/lib/active_support/message_pack/extensions.rb:3:require "bigdecimal" activesupport/lib/active_support/xml_mini.rb:5:require "bigdecimal" activesupport/lib/active_support/xml_mini.rb:6:require "bigdecimal/util" activesupport/test/core_ext/hash_ext_test.rb:4:require "bigdecimal" activesupport/test/core_ext/object/duplicable_test.rb:4:require "bigdecimal" activesupport/test/hash_with_indifferent_access_test.rb:4:require "bigdecimal" activesupport/test/json/encoding_test_cases.rb:3:require "bigdecimal" ``` By adding only to Active Support as a dependency, it should resolve the issue due to the dependency. ## Detail The warning is confirmed in the following step: ```ruby $ cat generic_main.rb # frozen_string_literal: true require 'bundler/inline' gemfile(true) do source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem "rails", github: "rails/rails", branch: "main" end require 'active_support' require 'minitest/autorun' # These gems will be bundled gems in Ruby 3.4 require 'bigdecimal' ``` Run generic_main.rb with Ruby 3.3.0dev below. ```console $ ruby -v ruby 3.3.0dev (2023-08-25T17:47:04Z master 7d32011399) [x86_64-darwin22] $ ruby generic_main.rb Fetching gem metadata from https://rubygems.org/....... Resolving dependencies... /Users/koic/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/bundler/gems/rails-a8871e6829e5/activesupport/lib/ active_support/core_ext/object/json.rb:5: warning: bigdecimal will be not part of the default gems since Ruby 3.4.0. Add bigdecimal to your Gemfile. Also contact author of to add bigdecimal into its gemspec. Run options: --seed 39015 # Running: Finished in 0.001313s, 0.0000 runs/s, 0.0000 assertions/s. 0 runs, 0 assertions, 0 failures, 0 errors, 0 skips ``` ## Additional information It is essentially the same as rails#48907.
1 parent a8871e6 commit a77535c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ PATH
8383
marcel (~> 1.0)
8484
activesupport (7.1.0.alpha)
8585
base64
86+
bigdecimal
8687
concurrent-ruby (~> 1.0, >= 1.0.2)
8788
connection_pool (>= 2.2.5)
8889
drb
@@ -155,6 +156,7 @@ GEM
155156
bcrypt (3.1.18)
156157
beaneater (1.1.3)
157158
benchmark-ips (2.10.0)
159+
bigdecimal (3.1.4)
158160
bindex (0.8.1)
159161
bootsnap (1.15.0)
160162
msgpack (~> 1.2)

activesupport/activesupport.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,5 @@ Gem::Specification.new do |s|
4242
s.add_dependency "base64"
4343
s.add_dependency "drb"
4444
s.add_dependency "mutex_m"
45+
s.add_dependency "bigdecimal"
4546
end

0 commit comments

Comments
 (0)