Skip to content

Commit b2c8586

Browse files
committed
Fixed club events returning an empty string for created_at.
1 parent d0cc188 commit b2c8586

File tree

4 files changed

+9989
-343
lines changed

4 files changed

+9989
-343
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* [#94](https://github.com/dblock/strava-ruby-client/pull/94): Adds video fields to `Strava::Models::Photo` - [@dblock](https://github.com/dblock).
44
* [#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).
5+
* [#95](https://github.com/dblock/strava-ruby-client/pull/95): Fixed `club_events` returning `Strava::Models::ClubEvent` with an empty string in `created_at` - [@dblock](https://github.com/dblock).
56
* [#93](https://github.com/dblock/strava-ruby-client/pull/93): Updates GitHub Actions workflows - [@simonneutert](https://github.com/simonneutert).
67
* Your contribution here.
78

lib/strava/models/club_event.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ClubEvent < Strava::Models::Response
1111
property 'club', transform_with: ->(c) { Strava::Models::Club.new(c) }
1212
property 'organizing_athlete', transform_with: ->(oa) { Strava::Models::Athlete.new(oa) }
1313
property 'activity_type'
14-
property 'created_at', transform_with: ->(v) { Time.parse(v) }
14+
property 'created_at', transform_with: ->(v) { Time.parse(v) if v&.length&.positive? }
1515
property 'route_id'
1616
property 'route', transform_with: ->(r) { Strava::Models::Route.new(r) }
1717
property 'women_only'
@@ -21,6 +21,7 @@ class ClubEvent < Strava::Models::Response
2121
property 'upcoming_occurrences', transform_with: ->(upcoming) { upcoming.map { |o| Time.parse(o) } }
2222
property 'zone'
2323
property 'address'
24+
property 'joined'
2425
property 'start_latlng'
2526

2627
def strava_url

0 commit comments

Comments
 (0)