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/CHANGELOG.md b/CHANGELOG.md index 94c4e37..0f9e65e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### 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). +* [#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. ### 2.0.0 (2025/06/02) 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 diff --git a/spec/integration/sequel_spec.rb b/spec/integration/sequel_spec.rb index e2d6d4b..c32e058 100644 --- a/spec/integration/sequel_spec.rb +++ b/spec/integration/sequel_spec.rb @@ -22,6 +22,7 @@ let!(:model) { SequelUser = Class.new(Sequel::Model(:users)) do include ActiveModel::Serialization + def self.model_name 'User' end