# Changing a polymorphic\_type in Rails

DevFeed: [Changing a polymorphic\_type in Rails](<https://devfeed.tech/articles/changing-a-polymorphic-type-in-rails-1343.md>)

Original publisher: [Read original article](<https://shopify.engineering/changing-polymorphic-type-rails>)

Author: Diego Gilon

Published: 2022-02-18T16:57:47Z

Content type: tutorial

Language: en

Sources: [Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering.md>), [Shopify Engineering - Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering-shopify-engineering.md>)

Topics: [data](<https://devfeed.tech/topics/data.md>)

Tags: [database](<https://devfeed.tech/tags/database.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [shopify](<https://devfeed.tech/tags/shopify.md>), [types](<https://devfeed.tech/tags/types.md>)

## AI overview

A step-by-step Rails tutorial on changing polymorphic association storage from class names to arbitrary strings, making future module and class renames easier.

## Source excerpt

How my team redefined the way we store one of the polymorphic associations in the Shopify codebase. This post is the solution we wish we found when we were looking.