Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Strava Ruby Client
# Strava Ruby Client<!-- omit in toc -->

[![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)
Expand All @@ -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<!-- omit in toc -->

- [Installation](#installation)
- [Usage](#usage)
Expand Down Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion lib/strava/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Strava
VERSION = '2.3.1'
VERSION = '3.0.0'
end
2 changes: 1 addition & 1 deletion lib/strava/webhooks/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down