From bf9032a1f573a24418b34b85a716c5f0369c1bff Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Mon, 25 May 2009 17:14:37 -0300 Subject: [PATCH] ActionItem1049: random theme --- app/helpers/application_helper.rb | 9 +++++++++ 1 file changed, 9 insertions(+), 0 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 131c205..1fd08ee 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -312,6 +312,15 @@ module ApplicationHelper def current_theme return session[:theme] if (session[:theme]) + + # utility for developers: set the theme to 'random' in development mode and + # you will get a different theme every request. This is interesting for + # testing + if ENV['RAILS_ENV'] == 'development' && @environment.theme == 'random' + @theme ||= Dir.glob('public/designs/themes/*').map { |f| File.basename(f) }.rand + return @theme + end + p = profile if p p.theme -- libgit2 0.21.2