# STI and Active Record

**URL:** <https://www.ruby-forum.com/t/sti-and-active-record/105415>\
**Category:** Rails\
**Created:** [May 29, 2007, 8:25pm UTC](https://www.ruby-forum.com/t/sti-and-active-record/105415 "2007-05-29T20:25:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [May 29, 2007, 8:25pm UTC](https://www.ruby-forum.com/t/sti-and-active-record/105415/1 "2007-05-29T20:25:21Z")

</div>

Hey,

I’m trying to use STI in my models, while writing a little cms.  
A have a model called Page and some subclasses like ContentPage,  
Sysfolder etc. Some classes share similar attributes, so I use STI and  
one table for all types.  
Now I’m writing a form for edititing a page and I want to have the  
opportunity to change the type of it at runtime. But that seems to be  
a problem:

When I say:

page = Page.find(x)  
page.type = ContentPage
