Add support for Grape 3.0 and test in CI

This commit is contained in:
Sami Samhuri 2025-12-03 11:29:55 -08:00
parent cce31fe187
commit 6f1e4037bc
No known key found for this signature in database
4 changed files with 8 additions and 5 deletions

View file

@ -22,6 +22,7 @@ jobs:
strategy: strategy:
matrix: matrix:
ruby-version: [3.4.4, 3.3.8, 3.2.8, 3.1.7] ruby-version: [3.4.4, 3.3.8, 3.2.8, 3.1.7]
grape-version: ['~> 2.3.0', '~> 3.0']
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@v1
@ -29,5 +30,9 @@ jobs:
ruby-version: ${{ matrix.ruby-version }} ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies - name: Install dependencies
run: bundle install --jobs 4 --retry 3 run: bundle install --jobs 4 --retry 3
env:
GRAPE_VERSION: ${{ matrix.grape-version }}
- name: Run tests - name: Run tests
run: bundle exec rake run: bundle exec rake
env:
GRAPE_VERSION: ${{ matrix.grape-version }}

View file

@ -3,6 +3,7 @@
### 2.0.1 (Next) ### 2.0.1 (Next)
* [#92](https://github.com/ruby-grape/grape-active_model_serializers/pull/92): Fix: accept nil serializer - [@mateusnava](https://github.com/mateusnava). * [#92](https://github.com/ruby-grape/grape-active_model_serializers/pull/92): Fix: accept nil serializer - [@mateusnava](https://github.com/mateusnava).
* [#100](https://github.com/ruby-grape/grape-active_model_serializers/pull/100): Fix compatibility with Grape 3.0 and test in CI - [@samsonjs](https://github.com/samsonjs).
* Your contribution here. * Your contribution here.
### 2.0.0 (2025/06/02) ### 2.0.0 (2025/06/02)

View file

@ -49,11 +49,7 @@ module Grape
end end
def innermost_scope def innermost_scope
if endpoint.respond_to?(:namespace_stackable) endpoint.inheritable_setting.namespace_stackable[:namespace]&.last
endpoint.namespace_stackable(:namespace).last
else
endpoint.settings.peek[:namespace]
end
end end
def meta_options def meta_options

View file

@ -22,6 +22,7 @@ describe 'Sequel Integration' do
let!(:model) { let!(:model) {
SequelUser = Class.new(Sequel::Model(:users)) do SequelUser = Class.new(Sequel::Model(:users)) do
include ActiveModel::Serialization include ActiveModel::Serialization
def self.model_name def self.model_name
'User' 'User'
end end