Skip to content

Instantly share code, notes, and snippets.

@ShopifyEng
Created February 17, 2022 23:43
Changing a polymorphic_type in Rails - key_vehicle.rb
key = Key.first
=> Key
vehicle_type: "Car"
vehicle_id: id
key.vehicle
# => Raises "NameError: uninitialized constant Car"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment