Okay, quick question, for ActiveRecord, on a new instance of the model (i.e. create), the only way to get the id of the row is at after_commit, is there a nifty way in calling back to after_commit after it it was during a create?
ah, think I got it 'after_commit :foo, :on => :create'
hmm, interesting, that seems to cause an infinite loop with another after_commit call :S
Yeah, so the background is, this is within a rails app, and more specifically ActionMailer (just so it's a little less abstract), controller calls MailerClass.send_message.deliver I've monkey patched send_message because we need to do things before and after the MailerClass actually sends the message, so the new send_message kind of looks like: dostuff, resp = orig_send_message.deliver, domorestuff, resp (where commas are linebreaks), but I'm finding .delive
I don't think TheBrayn's suggestion would work, because the calling controller needs the response, I think I've got to do what you've suggested. Just going to brb while I look at something real quick
The mailer service, modifies the message-id from what the application provides, AND what ActionMailer generates, but doesn't replace the Message ID in the returned response, instead it adds to the response hash, the monkey patch is to return the Message ID that was truly used by replacing the message-id
(this is Amazon/SES, sigh... https://github.com/aws/aws-sdk-rails/blob/master/lib/aws/rails/mailer.rb#L37)
I'm starting to ponder if it'd be easier to monkey patch that class, wrap around deliver!
zenspider: thanks for the help, I managed to get a solution where I didn't have to touch the controllers to get SES working right, think I'll be filing an issue on their github repo though