Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
Merge branch 'jamescook/master' into work
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Adams committed Dec 15, 2008
2 parents 8c8edab + b2ac754 commit d31eb22
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 5 additions & 1 deletion vendor/plugins/ansuz_savage_beast/init.rb
Expand Up @@ -4,7 +4,11 @@
# FIX for engines model reloading issue in development mode
if ENV['RAILS_ENV'] != 'production'
load_paths.each do |path|
Dependencies.load_once_paths.delete(path)
if( Rails::VERSION::STRING =~ /\A2\.2\.\d/ )
ActiveSupport::Dependencies.load_once_paths.delete(path)
else
Dependencies.load_once_paths.delete(path)
end
end
end

Expand Down
6 changes: 5 additions & 1 deletion vendor/plugins/engines/lib/engines/plugin.rb
Expand Up @@ -89,7 +89,11 @@ def add_plugin_view_paths
view_path = File.join(directory, 'app', 'views')
if File.exist?(view_path)
ActionController::Base.view_paths.insert(1, view_path) # push it just underneath the app
ActionView::TemplateFinder.process_view_paths(view_path)
if( Rails::VERSION::STRING =~ /\A2\.2\.\d/ )
ActionView::Base.process_view_paths(view_path)
else
ActionView::TemplateFinder.process_view_paths(view_path)
end
end
end

Expand Down
8 changes: 5 additions & 3 deletions vendor/plugins/theme_support/lib/patches/actionview_ex.rb
Expand Up @@ -4,7 +4,7 @@ module ActionView

# Extending <tt>ActionView::Base</tt> to support rendering themes
class Base
alias_method :theme_support_old_render_file, :render_file
alias_method :theme_support_old_render_file, :render
# Overrides the default <tt>Base#render_file</tt> to allow theme-specific views
def render_file(template_path, use_full_path = false, local_assigns = {})

Expand All @@ -15,9 +15,10 @@ def render_file(template_path, use_full_path = false, local_assigns = {})

@finder.prepend_view_path(search_path)
local_assigns['active_theme'] = get_current_theme(local_assigns)
theme_support_old_render_file(template_path, use_full_path, local_assigns)
# This isnt right, but it prevents breakage in 2.2.2 -james
theme_support_old_render_file :file => template_path, :layout => true, :locals => local_assigns

end
end
private

def force_liquid?
Expand All @@ -36,6 +37,7 @@ def get_current_theme(local_assigns)
return controller.current_theme || false
end
end

# Used with ActionMailers
if local_assigns.include? :current_theme
return local_assigns.delete :current_theme
Expand Down

0 comments on commit d31eb22

Please sign in to comment.