Skip to content
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
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,36 @@ jobs:
matrix:
include:
# Recent Rubies and Rails
- ruby-version: '3.3'
- ruby-version: '3.4'
rails-version: '8.1'
- ruby-version: '3.4'
rails-version: '8.0'
- ruby-version: '3.2'
- ruby-version: '3.4'
rails-version: '7.2'
- ruby-version: '3.3'
rails-version: '8.0'
- ruby-version: '3.3'
rails-version: '7.2'
- ruby-version: '3.3'
rails-version: '7.1'
- ruby-version: '3.2'
rails-version: '7.2'
- ruby-version: '3.2'
rails-version: '7.1'
- ruby-version: '3.2'
rails-version: '7.0'
- ruby-version: '3.1'
rails-version: '7.1'
- ruby-version: '3.0'
rails-version: '7.1'
rails-version: '7.0'
- ruby-version: '2.7'
rails-version: '7.1'
rails-version: '6.1'
- ruby-version: '2.7'
rails-version: '6.0'
- ruby-version: '2.6'
rails-version: '6.1'
- ruby-version: '2.6'
rails-version: '6.0'
- ruby-version: '2.7'
rails-version: '6.0'
- ruby-version: '2.6'
rails-version: '5.2'
# Old Rubies and Rails
Expand Down
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ group :test do
end
end
gem 'codeclimate-test-reporter', require: false
gem 'json', '< 2.10', require: false
gem 'm', '~> 1.5'
gem 'pry', '>= 0.10'
gem 'byebug', '~> 8.2' if RUBY_VERSION < '2.2'
Expand All @@ -96,6 +97,11 @@ group :development, :test do
gem 'rubocop-minitest', '~> 0.31.0', require: false
gem 'rubocop-rails', '~> 2.20.0', require: false
gem 'rubocop-rake', '~> 0.6.0', require: false

if RUBY_VERSION >= '3.4.0'
gem 'ostruct', require: false
gem 'mutex_m', require: false
end
end
if version <= '5.0'
gem 'loofah', '< 2.21.0'
Expand Down
4 changes: 3 additions & 1 deletion lib/active_model/serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# reified when subclassed to decorate a resource.
module ActiveModel
class Serializer
class_attribute :config
self.config = ActiveSupport::OrderedOptions.new

undef_method :select, :display # These IO methods, which are mixed into Kernel,
# sometimes conflict with attribute names. We don't need these IO methods.

Expand All @@ -30,7 +33,6 @@ class Serializer
autoload :HasOneReflection
autoload :HasManyReflection
end
include ActiveSupport::Configurable
include Caching

# @param resource [ActiveRecord::Base, ActiveModelSerializers::Model]
Expand Down
5 changes: 4 additions & 1 deletion test/serializers/reflection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ def test_no_href_in_vanilla_reflection
exception = assert_raise(NoMethodError) do
reflection.instance_eval(&link)
end
assert_match(/undefined method `href'/, exception.message)

expected = RUBY_VERSION >= '3.4.0' ? /undefined method 'href'/ : /undefined method `href'/

assert_match(expected, exception.message)
end

# rubocop:disable Metrics/AbcSize
Expand Down
1 change: 1 addition & 0 deletions test/support/isolated_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
# It is also good to know what is the bare minimum to get
# Rails booted up.
require 'bundler/setup' unless defined?(Bundler)
require 'logger'
require 'active_support'
require 'active_support/core_ext/string/access'

Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ENV['RAILS_ENV'] = 'test'
require 'bundler/setup'

require 'logger'
require 'pry'
require 'timecop'
require 'rails'
Expand Down