Skip to content

Commit

Permalink
Support Rails 8
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkit110 committed Nov 11, 2024
1 parent bda1950 commit 4f31ebd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
matrix:
include:
# Recent Rubies and Rails
- ruby-version: '3.3'
rails-version: '8.0'
- ruby-version: '3.2'
rails-version: '8.0'
- ruby-version: '3.2'
rails-version: '7.2'
- ruby-version: '3.2'
rails-version: '7.1'
- ruby-version: '3.1'
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ end

group :test do
platforms(*(@windows_platforms + [:ruby])) do
if version == 'master' || version >= '6'
if version >= '8'
gem 'sqlite3', '~> 2.1'
elsif version == 'master' || version >= '6'
gem 'sqlite3', '< 1.6'
else
gem 'sqlite3', '~> 1.3.13'
Expand Down
3 changes: 2 additions & 1 deletion lib/active_model_serializers/adapter/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def fragment_cache(cached_hash, non_cached_hash)
# see https://github.com/rails-api/active_model_serializers/pull/965
# When <tt>options</tt> is +nil+, sets it to +{}+
def serialization_options(options)
options ||= {} # rubocop:disable Lint/UselessAssignment
options ||= {}
options.frozen? ? options.dup : options
end

def root
Expand Down
2 changes: 1 addition & 1 deletion test/action_controller/json_api/linked_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def render_collection_with_include

setup do
@routes = Rails.application.routes.draw do
ActiveSupport::Deprecation.silence do
(Rails.try(:deprecator) || ActiveSupport::Deprecation).silence do
match ':action', to: LinkedTestController, via: [:get, :post]
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class WithoutRenderer < JsonApiRendererTest
make_basic_app

Rails.application.routes.draw do
ActiveSupport::Deprecation.silence do
(Rails.try(:deprecator) || ActiveSupport::Deprecation).silence do
match ':action', to: TestController, via: [:get, :post]
end
end
Expand Down Expand Up @@ -112,7 +112,7 @@ class WithRenderer < JsonApiRendererTest
make_basic_app

Rails.application.routes.draw do
ActiveSupport::Deprecation.silence do
(Rails.try(:deprecator) || ActiveSupport::Deprecation).silence do
match ':action', to: TestController, via: [:get, :post]
end
end
Expand Down

0 comments on commit 4f31ebd

Please sign in to comment.