Skip to content

Instantly share code, notes, and snippets.

@ShopifyEng
Created February 18, 2022 00:16
Changing a polymorphic_type in Rails - create_key.rb
new_key = Key.create(vehicle: Car.new)
new_key
=> Key
vehicle_type: "Car",
vehicle_id: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment