Skip to content

Instantly share code, notes, and snippets.

@enricob
Created July 17, 2009 18:22
Show Gist options
  • Save enricob/149210 to your computer and use it in GitHub Desktop.
Save enricob/149210 to your computer and use it in GitHub Desktop.
From 5f339cea3a179c5ba020420ebb8fe7c95f2053f6 Mon Sep 17 00:00:00 2001
From: Enrico Bianco <enricob@gmail.com>
Date: Fri, 17 Jul 2009 14:21:00 -0400
Subject: [PATCH] Regenerate @active_scaffold_paths even if one of @active_scaffold_overrides, @active_scaffold_custom_paths, or @active_scaffold_frontends is nil
diff --git a/lib/active_scaffold.rb b/lib/active_scaffold.rb
index d23c659..1604f36 100644
--- a/lib/active_scaffold.rb
+++ b/lib/active_scaffold.rb
@@ -134,7 +134,13 @@ module ActiveScaffold
end
def active_scaffold_paths
- @active_scaffold_paths ||= ActionView::PathSet.new(@active_scaffold_overrides + @active_scaffold_custom_paths + @active_scaffold_frontends) unless @active_scaffold_overrides.nil? || @active_scaffold_custom_paths.nil? || @active_scaffold_frontends.nil?
+ return @active_scaffold_paths unless @active_scaffold_paths.nil?
+
+ @active_scaffold_paths = ActionView::PathSet.new
+ @active_scaffold_paths.concat(@active_scaffold_overrides) unless @active_scaffold_overrides.nil?
+ @active_scaffold_paths.concat(@active_scaffold_custom_paths) unless @active_scaffold_custom_paths.nil?
+ @active_scaffold_paths.concat(@active_scaffold_frontends) unless @active_scaffold_frontends.nil?
+ @active_scaffold_paths
end
def active_scaffold_config
--
1.6.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment