Dynamoid
Dynamoid copied to clipboard
Single Table Inheritance .find and .all not working
With these classes
# 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.