diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-30 13:04:49 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-30 13:04:49 +0100 |
commit | fe09c8da70967ea591a3b01d7a70fc80490f3d8f (patch) | |
tree | 95a474ef17c30a3904038bfa18a4e608ad357abe | |
parent | 2b9208ac29e977ab627fe11c3613e4756ea9b70e (diff) |
When loading themes, only attempt to do so if it exists.
-rw-r--r-- | config/initializers/theme_loader.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb index df392cc08..4ddce6910 100644 --- a/config/initializers/theme_loader.rb +++ b/config/initializers/theme_loader.rb @@ -2,6 +2,9 @@ theme_urls = MySociety::Config.get("THEME_URLS", []) if ENV["RAILS_ENV"] != "test" # Don't let the theme interfere with Alaveteli specs for url in theme_urls.reverse theme_name = url.sub(/.*\/(.*).git/, "\\1") - require File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__ + theme_main_include = File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__ + if File.exists? theme_main_include + require theme_main_include + end end end |