diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index d596d5d..a45764c 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -6,7 +6,7 @@ jobs: env: BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.danger steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 with: fetch-depth: 0 - uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index b4734b0..6ede7d5 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -4,7 +4,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ac4454..4131717 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,9 +10,11 @@ jobs: - "3.1" - "3.2" - "3.3" + - "3.4" - "jruby-9.4" + - "jruby-10" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 267a2dd..d5fe9ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ -### 2.3.1 (Next) +### 3.0.0 (Next) +* [#92](https://github.com/dblock/strava-ruby-client/pull/92): Fixes Hashie::Trash serialization warning for `object_id` of `Strava::Webhooks::Models::Event` - [@simonneutert](https://github.com/simonneutert). * Your contribution here. ### 2.3.0 (2025/10/16) diff --git a/README.md b/README.md index 2f3b279..b1b4bd0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Strava Ruby Client +# Strava Ruby Client [![Gem Version](https://badge.fury.io/rb/strava-ruby-client.svg)](https://badge.fury.io/rb/strava-ruby-client) [![Test](https://github.com/dblock/strava-ruby-client/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/dblock/strava-ruby-client/actions/workflows/test.yml) @@ -7,7 +7,7 @@ A complete Ruby client for the [Strava API v3](https://developers.strava.com). Unlike other clients, including [strava-api-v3](https://github.com/jaredholdcroft/strava-api-v3), provides complete OAuth refresh token flow support, webhooks support, a richer first class interface to Strava models, conversion helpers for distance, time and elevation, natively supports pagination, implements more consistent error handling and is built with thorough test coverage using actual Strava data. -## Table of Contents +## Table of Contents - [Installation](#installation) - [Usage](#usage) @@ -895,7 +895,7 @@ event = Strava::Webhooks::Models::Event.new(JSON.parse(request.body)) event # => Strava::Webhooks::Models::Event event.object_type # => 'activity' -event.object_id # => 1991813808 +event.id # => 1991813808 event.aspect_type # => 'update' event.updates # => { 'sport_type' => 'Walk' } event.owner_id # => 29323238 diff --git a/UPGRADING.md b/UPGRADING.md index 6425481..d5cf9f6 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,5 +1,25 @@ # Upgrading Strava-Ruby-Client +### Upgrading to >= 3.0.0 + +The `Strava::Webhooks::Models::Event` model has been refactored to map the `object_id` field to `id` for consistency and to resolve Hashie::Trash serialization warnings. + +**Breaking Change**: If you're using webhooks and accessing the `object_id` property, you must now use `id` instead. + +**Before (v2.x):** +```ruby +event = Strava::Webhooks::Models::Event.new(JSON.parse(request.body)) +event.object_id # => 1991813808 +``` + +**After (v3.0.0):** +```ruby +event = Strava::Webhooks::Models::Event.new(JSON.parse(request.body)) +event.id # => 1991813808 +``` + +This change fixes the Hashie::Trash serialization warning that occurred when using `object_id` due to conflicts with Ruby's built-in `Object#object_id` method. + ### Upgrading to >= 2.3.0 Faraday can optionally exclude HTTP method, path and query params from the errors raised. The client implementation options will now default to `Faraday::Response::RaiseError::DEFAULT_OPTIONS` with `include_request` set to `true`. You can change this behavior by setting `Strava::Web::RaiseResponseError::DEFAULT_OPTIONS`. diff --git a/lib/strava/version.rb b/lib/strava/version.rb index 4f9576b..13d4a3e 100644 --- a/lib/strava/version.rb +++ b/lib/strava/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Strava - VERSION = '2.3.1' + VERSION = '3.0.0' end diff --git a/lib/strava/webhooks/models/event.rb b/lib/strava/webhooks/models/event.rb index 7d709c2..5fa927f 100644 --- a/lib/strava/webhooks/models/event.rb +++ b/lib/strava/webhooks/models/event.rb @@ -5,7 +5,7 @@ module Webhooks module Models class Event < Hashie::Trash property 'object_type' - property 'object_id' + property 'id', from: 'object_id' property 'aspect_type' property 'updates' property 'owner_id'