summaryrefslogtreecommitdiffstats
path: root/db/migrate/065_add_settings_updated_on.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-31 17:45:32 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-31 17:45:32 +0000
commit6bdc13b33d8d8d2052d029ac8f99ad0f62df6211 (patch)
tree63dfcae54f321345ea965def352c061634de1dad /db/migrate/065_add_settings_updated_on.rb
parent404bfce446915fe9dadcfce7b36d732813523e28 (diff)
downloadredmine-6bdc13b33d8d8d2052d029ac8f99ad0f62df6211.tar.gz
redmine-6bdc13b33d8d8d2052d029ac8f99ad0f62df6211.zip
Added cache for application settings (Setting model).
Once the values are cached, only one database query is done at each user request (to check if the cache is still valid). git-svn-id: http://redmine.rubyforge.org/svn/trunk@685 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate/065_add_settings_updated_on.rb')
-rw-r--r--db/migrate/065_add_settings_updated_on.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/db/migrate/065_add_settings_updated_on.rb b/db/migrate/065_add_settings_updated_on.rb
new file mode 100644
index 000000000..8c5fde33b
--- /dev/null
+++ b/db/migrate/065_add_settings_updated_on.rb
@@ -0,0 +1,11 @@
+class AddSettingsUpdatedOn < ActiveRecord::Migration
+ def self.up
+ add_column :settings, :updated_on, :timestamp
+ # set updated_on
+ Setting.find(:all).each(&:save)
+ end
+
+ def self.down
+ remove_column :settings, :updated_on
+ end
+end