Skip to content

Commit

Permalink
Add vehicle_positions to Ride model
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-ioki committed Aug 28, 2024
1 parent 8622772 commit d20c721
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ioki/model/operator/ride.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ class Ride < Base
on: :read,
type: :string

attribute :vehicle_positions,
on: :read,
type: :array,
class_name: 'VehiclePosition'

attribute :vehicle_reached_dropoff,
on: :read,
type: :boolean
Expand Down
1 change: 1 addition & 0 deletions spec/ioki/model/operator/ride_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
it { is_expected.to define_attribute(:valid_for_passenger_until).as(:date_time) }
it { is_expected.to define_attribute(:vehicle).as(:object).with(class_name: 'Vehicle') }
it { is_expected.to define_attribute(:vehicle_id).as(:string) }
it { is_expected.to define_attribute(:vehicle_positions).as(:array).with(class_name: 'VehiclePosition') }
it { is_expected.to define_attribute(:vehicle_reached_dropoff).as(:boolean) }
it { is_expected.to define_attribute(:vehicle_reached_pickup).as(:boolean) }
end

0 comments on commit d20c721

Please sign in to comment.