[Radiant] Migrating my Extension

2008-05-22 Thread Chris Parrish

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

___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] Migrating my Extension

2008-05-22 Thread Chris Parrish
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

Sean Cribbs wrote:
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

Chris Parrish wrote:

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

___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant



___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant