<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -57,16 +57,7 @@ module ActiveScaffold
       klass = self.active_scaffold_config.model
       klass.define_attribute_methods unless klass.generated_methods?
 
-      if Rails::VERSION::MAJOR == 2 &amp;&amp; Rails::VERSION::MINOR == 2
-        self.append_view_path(File.join(Rails.root, 'app', 'views', controller_path))
-        ActionController::Base.view_paths.each do |dir|
-          self.append_view_path(File.join(dir,&quot;active_scaffold_overrides&quot;)) if File.exists?(File.join(dir,&quot;active_scaffold_overrides&quot;))
-        end
-        if active_scaffold_config.frontend.to_sym != :default
-          self.append_view_path(File.join(Rails.root, 'vendor', 'plugins', ActiveScaffold::Config::Core.plugin_directory, 'frontends', active_scaffold_config.frontend.to_s , 'views'))
-        end
-        self.append_view_path(File.join(Rails.root, 'vendor', 'plugins', ActiveScaffold::Config::Core.plugin_directory, 'frontends', 'default' , 'views'))
-      else
+      if Rails::VERSION::MAJOR == 2 &amp;&amp; Rails::VERSION::MINOR &lt; 2
         # set up the generic_view_paths (Rails 2.x)
         frontends_path = File.join(Rails.root, 'vendor', 'plugins', ActiveScaffold::Config::Core.plugin_directory, 'frontends')
 
@@ -77,6 +68,15 @@ module ActiveScaffold
         paths &lt;&lt; File.join(frontends_path, active_scaffold_config.frontend, 'views') if active_scaffold_config.frontend.to_sym != :default
         paths &lt;&lt; File.join(frontends_path, 'default', 'views')
         self.generic_view_paths = paths
+      else
+        self.append_view_path(File.join(Rails.root, 'app', 'views', controller_path))
+        ActionController::Base.view_paths.each do |dir|
+          self.append_view_path(File.join(dir,&quot;active_scaffold_overrides&quot;)) if File.exists?(File.join(dir,&quot;active_scaffold_overrides&quot;))
+        end
+        if active_scaffold_config.frontend.to_sym != :default
+          self.append_view_path(File.join(Rails.root, 'vendor', 'plugins', ActiveScaffold::Config::Core.plugin_directory, 'frontends', active_scaffold_config.frontend.to_s , 'views'))
+        end
+        self.append_view_path(File.join(Rails.root, 'vendor', 'plugins', ActiveScaffold::Config::Core.plugin_directory, 'frontends', 'default' , 'views'))
       end
 
       # include the rest of the code into the controller: the action core and the included actions</diff>
      <filename>lib/active_scaffold.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,72 @@
-if Rails::VERSION::MAJOR == 2 &amp;&amp; Rails::VERSION::MINOR == 2
+if Rails::VERSION::MAJOR == 2 &amp;&amp; Rails::VERSION::MINOR &lt; 2
+  # The view_paths functionality in Edge Rails (Rails 2.0) doesn't support
+  # the idea of a fallback generic template file, such as what make ActiveScaffold
+  # work. This patch adds generic_view_paths, which are folders containing templates
+  # that may apply to all controllers.
+  #
+  # There is one major difference with generic_view_paths, though. They should
+  # *not* be used unless the action has been explicitly defined in the controller.
+  # This is in contrast to how Rails will normally bypass the controller if it sees
+  # a partial.
+
+  class ActionController::Base
+    class_inheritable_accessor :generic_view_paths
+    self.generic_view_paths = []
+
+    # Returns the view path that contains the given relative template path.
+    def find_generic_base_path_for(template_path, extension)
+      self.generic_view_paths.each do |generic_path|
+        template_file_name = File.basename(&quot;#{template_path}.#{extension}&quot;)
+        generic_file_path = File.join(generic_path, template_file_name)
+        return generic_file_path if File.file?(generic_file_path)
+      end
+      nil
+    end
+  end
+
+  class ActionView::TemplateFinder
+
+    def pick_template_with_generic_paths(template_path, extension)
+      path = pick_template_without_generic_paths(template_path, extension)
+      if path.blank? and search_generic_view_paths?
+        path = controller.find_generic_base_path_for(template_path, extension)
+      end
+      path
+    end
+    alias_method_chain :pick_template, :generic_paths
+    alias_method :template_exists?, :pick_template # re-alias to the new pick_template
+
+    def find_template_extension_from_handler_with_generic_paths(template_path, template_format = @template.template_format)
+      extension = find_template_extension_from_handler_without_generic_paths(template_path, template_format)
+      if extension.blank? and search_generic_view_paths?
+        self.class.template_handler_extensions.each do |handler_extension|
+          return handler_extension if controller.find_generic_base_path_for(template_path, handler_extension)
+        end
+      end
+      extension
+    end
+    alias_method_chain :find_template_extension_from_handler, :generic_paths
+
+  protected
+
+    # We don't want to use generic_view_paths in ActionMailer, and we don't want
+    # to use them unless the controller action was explicitly defined.
+    def search_generic_view_paths?
+      controller.respond_to?(:generic_view_paths) and controller.class.action_methods.include?(controller.action_name)
+    end
+
+  private
+
+    def controller
+      @template.controller
+    end
+  end
+else
+
   class ActionController::Base
     class_inheritable_accessor :generic_view_paths
     self.generic_view_paths = []
-  
+
     # Returns the view path that contains the given relative template path.
     def find_generic_base_path_for(template_path, extension)
       self.generic_view_paths.each do |generic_path|
@@ -13,7 +77,7 @@ if Rails::VERSION::MAJOR == 2 &amp;&amp; Rails::VERSION::MINOR == 2
       nil
     end
   end
-  
+
   class ActionView::Base
     def template_exists?(template)
       begin
@@ -22,11 +86,11 @@ if Rails::VERSION::MAJOR == 2 &amp;&amp; Rails::VERSION::MINOR == 2
         return nil
       end
     end
-    
+
     private
     def _pick_template_with_generic(template_path)
       return template_path if template_path.respond_to?(:render)
-  
+
       path = template_path.sub(/^\//, '')
       if m = path.match(/(.*)\.(\w+)$/)
         template_file_name, template_file_extension = m[1], m[2]
@@ -36,7 +100,7 @@ if Rails::VERSION::MAJOR == 2 &amp;&amp; Rails::VERSION::MINOR == 2
       if m = template_file_name.match(/\/(\w+)$/)
         generic_template = m[1]
       end
-  
+
       # OPTIMIZE: Checks to lookup template in view path
       if template = self.view_paths[&quot;#{template_file_name}.#{template_format}&quot;]
         template
@@ -51,7 +115,7 @@ if Rails::VERSION::MAJOR == 2 &amp;&amp; Rails::VERSION::MINOR == 2
         template
       else
         template = ActionView::Template.new(template_path, view_paths)
-  
+
         if self.class.warn_cache_misses &amp;&amp; logger
           logger.debug &quot;[PERFORMANCE] Rendering a template that was &quot; +
             &quot;not found in view path. Templates outside the view path are &quot; +
@@ -59,74 +123,11 @@ if Rails::VERSION::MAJOR == 2 &amp;&amp; Rails::VERSION::MINOR == 2
             &quot;file into #{view_paths.join(':')} or add the folder to your &quot; +
             &quot;view path list&quot;
         end
-  
+
         template
       end
     end
     alias_method_chain :_pick_template, :generic
-    
-  end
-else
-  # The view_paths functionality in Edge Rails (Rails 2.0) doesn't support
-  # the idea of a fallback generic template file, such as what make ActiveScaffold
-  # work. This patch adds generic_view_paths, which are folders containing templates
-  # that may apply to all controllers.
-  #
-  # There is one major difference with generic_view_paths, though. They should
-  # *not* be used unless the action has been explicitly defined in the controller.
-  # This is in contrast to how Rails will normally bypass the controller if it sees
-  # a partial.
-   
-  class ActionController::Base
-    class_inheritable_accessor :generic_view_paths
-    self.generic_view_paths = []
-   
-    # Returns the view path that contains the given relative template path.
-    def find_generic_base_path_for(template_path, extension)
-      self.generic_view_paths.each do |generic_path|
-        template_file_name = File.basename(&quot;#{template_path}.#{extension}&quot;)
-        generic_file_path = File.join(generic_path, template_file_name)
-        return generic_file_path if File.file?(generic_file_path)
-      end
-      nil
-    end
-  end
-   
-  class ActionView::TemplateFinder
-   
-    def pick_template_with_generic_paths(template_path, extension)
-      path = pick_template_without_generic_paths(template_path, extension)
-      if path.blank? and search_generic_view_paths?
-        path = controller.find_generic_base_path_for(template_path, extension)
-      end
-      path
-    end
-    alias_method_chain :pick_template, :generic_paths
-    alias_method :template_exists?, :pick_template # re-alias to the new pick_template
-   
-    def find_template_extension_from_handler_with_generic_paths(template_path, template_format = @template.template_format)
-      extension = find_template_extension_from_handler_without_generic_paths(template_path, template_format)
-      if extension.blank? and search_generic_view_paths?
-        self.class.template_handler_extensions.each do |handler_extension|
-          return handler_extension if controller.find_generic_base_path_for(template_path, handler_extension)
-        end
-      end
-      extension
-    end
-    alias_method_chain :find_template_extension_from_handler, :generic_paths
-   
-  protected
-   
-    # We don't want to use generic_view_paths in ActionMailer, and we don't want
-    # to use them unless the controller action was explicitly defined.
-    def search_generic_view_paths?
-      controller.respond_to?(:generic_view_paths) and controller.class.action_methods.include?(controller.action_name)
-    end
-   
-  private
-   
-    def controller
-      @template.controller
-    end
+
   end
 end
\ No newline at end of file</diff>
      <filename>lib/extensions/generic_view_paths.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cab391cd7ffac028f84bf7be1f1118034d93fdba</id>
    </parent>
  </parents>
  <author>
    <name>Mike Gaffney</name>
    <email>mike.gaffney@asolutions.com</email>
  </author>
  <url>http://github.com/gaffo/active_scaffold/commit/88c6be49119ed4a7a05807d6f784099cbf740d86</url>
  <id>88c6be49119ed4a7a05807d6f784099cbf740d86</id>
  <committed-date>2008-11-13T07:36:28-08:00</committed-date>
  <authored-date>2008-11-13T07:36:28-08:00</authored-date>
  <message>changed the version check for 2.2 per sergio</message>
  <tree>881555242d74acebc185488c3833ac02641eb524</tree>
  <committer>
    <name>Mike Gaffney</name>
    <email>mike.gaffney@asolutions.com</email>
  </committer>
</commit>
