# app/models/vehicle.rb
class Vehicle
include Dynamoid::Document
table key: :vehicle_id
field :vehicle_id
field :type
end
# app/models/car.rb
class Car < Vehicle
end
# app/models/boat.rb
class Boat < Vehicle
end
Car.all and Car.find(id) return the same thing Vehicle.all and Vehicle.find(id), which include Boat objects.
With these classes
Car.all
andCar.find(id)
return the same thingVehicle.all
andVehicle.find(id)
, which include Boat objects.