From 3a2ebc0b32e1008126b449e73ad0873901963b5d Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Wed, 3 Dec 2025 11:29:55 -0800 Subject: [PATCH] Add support for Grape 3.0 and test in CI --- .github/workflows/ci.yml | 5 +++++ lib/grape-active_model_serializers/options_builder.rb | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 559f536..c04a80e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: strategy: matrix: ruby-version: [3.4.4, 3.3.8, 3.2.8, 3.1.7] + grape-version: ['~> 2.3.0', '~> 3.0'] steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 @@ -29,5 +30,9 @@ jobs: ruby-version: ${{ matrix.ruby-version }} - name: Install dependencies run: bundle install --jobs 4 --retry 3 + env: + GRAPE_VERSION: ${{ matrix.grape-version }} - name: Run tests run: bundle exec rake + env: + GRAPE_VERSION: ${{ matrix.grape-version }} diff --git a/lib/grape-active_model_serializers/options_builder.rb b/lib/grape-active_model_serializers/options_builder.rb index e415d40..8975214 100644 --- a/lib/grape-active_model_serializers/options_builder.rb +++ b/lib/grape-active_model_serializers/options_builder.rb @@ -49,11 +49,7 @@ def default_root_options end def innermost_scope - if endpoint.respond_to?(:namespace_stackable) - endpoint.namespace_stackable(:namespace).last - else - endpoint.settings.peek[:namespace] - end + endpoint.inheritable_setting.namespace_stackable[:namespace]&.last end def meta_options