Skip to content

Commit 6f1e403

Browse files
committed
Add support for Grape 3.0 and test in CI
1 parent cce31fe commit 6f1e403

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,17 @@ jobs:
2222
strategy:
2323
matrix:
2424
ruby-version: [3.4.4, 3.3.8, 3.2.8, 3.1.7]
25+
grape-version: ['~> 2.3.0', '~> 3.0']
2526
steps:
2627
- uses: actions/checkout@v4
2728
- uses: ruby/setup-ruby@v1
2829
with:
2930
ruby-version: ${{ matrix.ruby-version }}
3031
- name: Install dependencies
3132
run: bundle install --jobs 4 --retry 3
33+
env:
34+
GRAPE_VERSION: ${{ matrix.grape-version }}
3235
- name: Run tests
3336
run: bundle exec rake
37+
env:
38+
GRAPE_VERSION: ${{ matrix.grape-version }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### 2.0.1 (Next)
44

55
* [#92](https://github.com/ruby-grape/grape-active_model_serializers/pull/92): Fix: accept nil serializer - [@mateusnava](https://github.com/mateusnava).
6+
* [#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).
67
* Your contribution here.
78

89
### 2.0.0 (2025/06/02)

lib/grape-active_model_serializers/options_builder.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ def default_root_options
4949
end
5050

5151
def innermost_scope
52-
if endpoint.respond_to?(:namespace_stackable)
53-
endpoint.namespace_stackable(:namespace).last
54-
else
55-
endpoint.settings.peek[:namespace]
56-
end
52+
endpoint.inheritable_setting.namespace_stackable[:namespace]&.last
5753
end
5854

5955
def meta_options

spec/integration/sequel_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
let!(:model) {
2323
SequelUser = Class.new(Sequel::Model(:users)) do
2424
include ActiveModel::Serialization
25+
2526
def self.model_name
2627
'User'
2728
end

0 commit comments

Comments
 (0)