Created
March 22, 2017 17:12
-
-
Save jarod022/d359f65ecefedff011cc8e0d13d1404f to your computer and use it in GitHub Desktop.
Rails: how to save up database queries using cache
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
class Setting < ActiveRecord::Base | |
after_save :update_cached_settings | |
private | |
def update_cached_settings | |
SettingsCacher.new.write | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment