Skip to content

Commit 1343bb0

Browse files
committed
Applied Dave Shenk's fix for 2.1 compatibility (http://code.google.com/p/rails-multisite/issues/detail?id=4)
1 parent 709747e commit 1343bb0

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*rails2.1.x tag*
2+
3+
* Apply Dave Shenk's fix for 2.1 internals. Untested!
4+
5+
*rails2.0.x tag*
6+
7+
* Moved repository to Github

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2007 Gabe da Silveira, based on code from theme_support by Matt McCray, based on code from Typo by Tobias Luetke
1+
Copyright (c) 2007-2009 Gabe da Silveira, based on code from theme_support by Matt McCray, based on code from Typo by Tobias Luetke
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

README

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ The essential functionality of the plugin is to add a specific site's views to t
66

77
== Requirements
88

9-
* This plugin is tested in Rails 2.0.2.
10-
* Template caching must be disabled (this includes both cache_template_loading and cache_template_extensions action_view config options)
9+
* This plugin is tested in Rails 2.0.2. Updates for Rails 2.1 and 2.2 (see tags) have been submitted but are untested by me.
1110

1211
== Differences from theme_support
1312

@@ -54,13 +53,4 @@ You can also defer the theme lookup to a controller method:
5453

5554

5655
Note: By setting the site in the ApplicationController you can set
57-
the site for the whole application.
58-
59-
== Changelog
60-
61-
1.0.0 - Initial release
62-
63-
64-
---
65-
Copyright (c) 2007-2008 Gabe da Silveira, based on code from theme_support by Matt McCray, based on code from Typo by Tobias Luetke
66-
released under the MIT license
56+
the site for the whole application.

lib/patches/actioncontroller_ex.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ def current_site(passed_site=nil)
3434
protected
3535
def add_multisite_path
3636
if current_site
37-
raise "Multisite plugin is incompatible with template caching. You must set config.action_view.cache_template_loading to false in your environment." if ActionView::Base.cache_template_loading
38-
raise "Multisite plugin is incompatible with template extension caching. You must set config.action_view.cache_template_extensions to false in your environment." if ActionView::Base.cache_template_extensions
3937
new_path = File.join(RAILS_ROOT, 'sites', @active_site, 'views')
40-
@template.prepend_view_path(new_path)
41-
logger.info " Template View Paths: #{@template.view_paths.inspect}"
38+
self.prepend_view_path(new_path)
39+
logger.info " Template View Paths: #{self.view_paths.inspect}"
4240
end
4341
return true
4442
end

0 commit comments

Comments
 (0)