Are you restarting the delayed_job worker after any changes to your app? DJ loads your app as it exists when the worker starts -- even in development.
What does your delayed_job method look like? Can you update the attribute without issues from the console? On Thu, Mar 18, 2010 at 1:03 AM, Chris McCann <[email protected]> wrote: > This is a strange one. I have a model that has a field called > magazine_subscription (string). If I update that field in a form it > gets saved to the database just as one would expect. > > But if I use a delayed_job to update a collection of model objects, > the magazine_subscription field doesn't get updated but other fields > do. I just see a bunch of entries like this in the log: > > SQL (0.1ms) BEGIN > Model Update (0.3ms) UPDATE `model` SET `mail_flag` = 0, `status` > = 'DR', `updated_on` = '2010-03-18 07:42:34' WHERE `id` = 1234 > SQL (0.6ms) COMMIT > > I tried just updating the magazine_subscription field and got this in > the log: > > SQL (2.3ms) BEGIN > SQL (0.1ms) COMMIT > > I've tried setting the model attributes and saving them: > > magazine_subscription = "None" > model.save > > Again, the other two update but not magazine_subscription. I've tried > using model.update_attribute and update_attributes, again, it will > update the other two fields but not magazine_subscription. > > I've tried rearranging the order of the fields in the > update_attributes call but no luck. > > The magazine_subscription field is the last one listed in schema.rb > and in the database (the model has 56 fields), for what it's worth. > > This is driving me a little batty. Has anyone seen this behavior > before in Rails 2.3.5? Is there something obvious I'm missing? > > Cheers, > > Chris > > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby > -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
