Created
September 22, 2012 01:39
-
-
Save tonatiuh/3764818 to your computer and use it in GitHub Desktop.
Update another record on after_save on model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after_save :bid_adjusts | |
def bid_adjusts | |
unless @old_exclusive_campaign.nil? | |
campaign = Campaign.find(@old_exclusive_campaign.id) | |
campaign.update_attributes(exclusivity: false) | |
campaign.save | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know if you need to reload the old_campaign object... as we're using let