Skip to content

Commit fae99ee

Browse files
authored
Merge pull request #2428 from jpawlyn/0-10-stable
Relax gem requirement to allow Rails 7
2 parents 669b0a3 + c91c789 commit fae99ee

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ jobs:
1313
matrix:
1414
include:
1515
# Recent Rubies and Rails
16+
- ruby-version: '3.1'
17+
rails-version: '7.0'
18+
- ruby-version: '3.0'
19+
rails-version: '7.0'
20+
- ruby-version: '2.7'
21+
rails-version: '7.0'
1622
- ruby-version: '2.6'
1723
rails-version: '6.1'
1824
- ruby-version: '2.6'

active_model_serializers.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
2121

2222
spec.required_ruby_version = '>= 2.1'
2323

24-
rails_versions = ['>= 4.1', '< 7.0']
24+
rails_versions = ['>= 4.1', '< 7.1']
2525
spec.add_runtime_dependency 'activemodel', rails_versions
2626
# 'activesupport', rails_versions
2727
# 'builder'

test/action_controller/serialization_test.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Serialization
77
class ImplicitSerializerTest < ActionController::TestCase
88
class ImplicitSerializationTestController < ActionController::Base
99
include SerializationTesting
10+
1011
def render_using_implicit_serializer
1112
@profile = Profile.new(name: 'Name 1', description: 'Description 1', comments: 'Comments 1')
1213
render json: @profile
@@ -75,8 +76,12 @@ def render_json_array_object_without_serializer
7576
render json: [{ error: 'Result is Invalid' }]
7677
end
7778

79+
# HACK: to prevent the resetting of instance variables after each request in Rails 7
80+
# see https://github.com/rails/rails/pull/43735
81+
def clear_instance_variables_between_requests; end
82+
7883
def update_and_render_object_with_cache_enabled
79-
@post.updated_at = Time.zone.now
84+
@post.updated_at = Time.zone.now # requires hack above to prevent `NoMethodError: undefined method `updated_at=' for nil:NilClass`
8085

8186
generate_cached_serializer(@post)
8287
render json: @post

0 commit comments

Comments
 (0)