# Migrating my Extension

**URL:** <https://www.ruby-forum.com/t/migrating-my-extension/138411>\
**Category:** Radiant CMS\
**Created:** [May 22, 2008, 7:03pm UTC](https://www.ruby-forum.com/t/migrating-my-extension/138411 "2008-05-22T19:03:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [May 22, 2008, 7:03pm UTC](https://www.ruby-forum.com/t/migrating-my-extension/138411/1 "2008-05-22T19:03:39Z")

</div>

What’s the secret to creating a migration for my extension that changes  
the data yet doesn’t trigger the UserActionObserver?

I already figured out that I need to set MyClass.record\_timestamps =  
false so that I don’t artificially change the updated\_at field, but  
changing a value and saving that record still causes the updated\_by  
field to loose the user\_id since migrations don’t have any user  
assigned.

What am I missing?

-Chris

---

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [May 22, 2008, 8:05pm UTC](https://www.ruby-forum.com/t/migrating-my-extension/138411/2 "2008-05-22T20:05:32Z")

</div>

If it’s something that can be updated wholesale (i.e. the same for every  
record, or derived on the same attributes), you can use  
MyClass.update\_all, which will not cause them to be loaded with  
ActiveRecord.

Sean

---

<div class="post-metadata">

**Author:** ![mahadewa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mahadewa](https://www.ruby-forum.com/u/mahadewa)\
**Post date:** [May 22, 2008, 8:36pm UTC](https://www.ruby-forum.com/t/migrating-my-extension/138411/3 "2008-05-22T20:36:08Z")

</div>

It can’t - it’s a calculation based on each record. I just don’t want  
to clobber people’s data.

I’m looking into an alternate approach right now so I may get around the  
need altogether. Still, it seems like something AR would allow during a  
migrate…

-Chris
