aboutsummaryrefslogtreecommitdiffstats
path: root/config/initializers
diff options
context:
space:
mode:
authorMark Longair <mhl@pobox.com>2013-11-29 08:28:20 +0000
committerMark Longair <mhl@pobox.com>2013-12-03 10:54:33 +0000
commitaa9c6b15d3a021709ad5f7b3b653ca914a8c40b8 (patch)
treede4c2a288b8e182adea8a574513bfb3ddf08f580 /config/initializers
parent6c4bf2ee10fca5030810a16c5b5b7c2a9b65dc9a (diff)
Move themes from vendor/plugins to lib/themes
These are essentially required in exactly the same way as before, but from lib/themes rather than vendor/plugins. This is the simplest possible change in order make the themes work outside vendor/plugins, I think, but it's not necessarily ideal. It would be worth considering whether these should be changed to Rails engines, as described here: http://guides.rubyonrails.org/engines.html
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/theme_loader.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb
index b3ae11e1e..9c79e513c 100644
--- a/config/initializers/theme_loader.rb
+++ b/config/initializers/theme_loader.rb
@@ -3,7 +3,9 @@
$alaveteli_route_extensions = []
def require_theme(theme_name)
- theme_main_include = File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__
+ theme_lib = Rails.root.join 'lib', 'themes', theme_name, 'lib'
+ $LOAD_PATH.unshift theme_lib.to_s
+ theme_main_include = Rails.root.join theme_lib, "alavetelitheme.rb"
if File.exists? theme_main_include
require theme_main_include
end