<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/autotest/discover.rb</filename>
    </added>
    <added>
      <filename>spec/routing_extension_spec.rb</filename>
    </added>
    <added>
      <filename>spec/spec.opts</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -9,15 +9,16 @@ module SubdomainFu
 
     def recognition_conditions_with_subdomain
       result = recognition_conditions_without_subdomain
-      result &lt;&lt; &quot;conditions[:subdomain] === env[:subdomain]&quot; if conditions[:subdomain] &amp;&amp; conditions[:subdomain] != true
+      result &lt;&lt; &quot;conditions[:subdomain] === env[:subdomain]&quot; if conditions[:subdomain] &amp;&amp; conditions[:subdomain] != true &amp;&amp; conditions[:subdomain] != false
       result &lt;&lt; &quot;SubdomainFu.has_subdomain?(env[:subdomain])&quot; if conditions[:subdomain] == true
+      result &lt;&lt; &quot;!SubdomainFu.has_subdomain?(env[:subdomain])&quot; if conditions[:subdomain] == false
       result
     end
   end
   
   module RouteSetExtensions
     def self.included(base)
-      base.alias_method_chain :extract_request_environment, :subdomain      
+      base.alias_method_chain :extract_request_environment, :subdomain  
     end
 
     def extract_request_environment_with_subdomain(request)
@@ -25,4 +26,7 @@ module SubdomainFu
       env.merge(:host =&gt; request.host, :domain =&gt; request.domain, :subdomain =&gt; SubdomainFu.subdomain_from(request.host))
     end
   end
-end
\ No newline at end of file
+end
+
+ActionController::Routing::RouteSet.send :include, SubdomainFu::RouteSetExtensions
+ActionController::Routing::Route.send :include, SubdomainFu::RouteExtensions
\ No newline at end of file</diff>
      <filename>lib/subdomain_fu/routing_extensions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,4 @@ require 'subdomain-fu'
 
 ActionController::Base.send :include, SubdomainFu::Controller
 
-ActionController::Routing::RouteSet.send :include, SubdomainFu::RouteSetExtensions
-ActionController::Routing::Route.send :include, SubdomainFu::RouteExtensions
-
 RAILS_DEFAULT_LOGGER.info(&quot;** SubdomainFu: initialized properly&quot;)
\ No newline at end of file</diff>
      <filename>rails/init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,10 +10,24 @@ ActiveRecord::Base.logger = Logger.new(plugin_spec_dir + &quot;/debug.log&quot;)
 
 ActionController::Routing::Routes.draw do |map|
   map.needs_subdomain '/needs_subdomain', :controller =&gt; &quot;fu&quot;, :action =&gt; &quot;awesome&quot;, :conditions =&gt; {:subdomain =&gt; true}
-  map.resources :fu_somethings, :conditions =&gt; {:subdomain =&gt; true}
+  map.no_subdomain '/no_subdomain', :controller =&gt; &quot;fu&quot;, :action =&gt; &quot;lame&quot;, :conditions =&gt; {:subdomain =&gt; false}
+  map.needs_awesome '/needs_awesome', :controller =&gt; &quot;fu&quot;, :action =&gt; &quot;lame&quot;, :conditions =&gt; {:subdomain =&gt; 'awesome'}
+  
+  map.resources :foos, :conditions =&gt; {:subdomain =&gt; true} do |fu|
+    fu.resources :bars
+  end
+  
   map.connect '/:controller/:action/:id'
 end
 
+class Paramed
+  def initialize(param)
+    @param = param
+  end
+  
+  def to_param
+    @param || &quot;param&quot;
+  end
+end
 
-include ActionController::UrlWriter
-default_url_options[:host] = &quot;testapp.com&quot;
\ No newline at end of file
+include ActionController::UrlWriter
\ No newline at end of file</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/spec_helper'
 describe &quot;SubdomainFu URL Writing&quot; do
   before do
     SubdomainFu.tld_size = 1
+    default_url_options[:host] = &quot;testapp.com&quot;
   end
   
   describe &quot;#url_for&quot; do
@@ -43,8 +44,31 @@ describe &quot;SubdomainFu URL Writing&quot; do
     end
   end
   
+  describe &quot;Resourced Routes&quot; do
+    it &quot;should be able to add a subdomain&quot; do
+      foo_path(:id =&gt; &quot;something&quot;, :subdomain =&gt; &quot;awesome&quot;).should == &quot;http://awesome.testapp.com/foos/something&quot;
+    end
+    
+    it &quot;should be able to remove a subdomain&quot; do
+      default_url_options[:host] = &quot;awesome.testapp.com&quot;
+      foo_path(:id =&gt; &quot;something&quot;, :subdomain =&gt; false).should == &quot;http://testapp.com/foos/something&quot;
+    end
+
+    it &quot;should work when passed in a paramable object&quot; do
+      foo_path(Paramed.new(&quot;something&quot;), :subdomain =&gt; &quot;awesome&quot;).should == &quot;http://awesome.testapp.com/foos/something&quot;
+    end
+    
+    it &quot;should work on nested resource collections&quot; do
+      foo_bars_path(Paramed.new(&quot;something&quot;), :subdomain =&gt; &quot;awesome&quot;).should == &quot;http://awesome.testapp.com/foos/something/bars&quot;
+    end
+    
+    it &quot;should work on nested resource members&quot; do
+      foo_bar_path(Paramed.new(&quot;something&quot;),Paramed.new(&quot;else&quot;), :subdomain =&gt; &quot;awesome&quot;).should == &quot;http://awesome.testapp.com/foos/something/bars/else&quot;
+    end
+  end
+  
   after do
     SubdomainFu.tld_size = 0
-    default_url_options[:host] = &quot;testapp.com&quot;
+    default_url_options[:host] = &quot;localhost&quot;
   end
 end
\ No newline at end of file</diff>
      <filename>spec/url_rewriter_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>20e59df8725c15799999c736e57daac9527ecd44</id>
    </parent>
  </parents>
  <author>
    <name>Michael Bleigh</name>
    <email>michael@intridea.com</email>
  </author>
  <url>http://github.com/mbleigh/subdomain-fu/commit/915de7ace2fd2c5b25dd10bae66c55d8c6419f85</url>
  <id>915de7ace2fd2c5b25dd10bae66c55d8c6419f85</id>
  <committed-date>2008-06-17T09:52:04-07:00</committed-date>
  <authored-date>2008-06-17T09:52:04-07:00</authored-date>
  <message>Autotest is now working, added specs for resource-routing url writing. Routing extensions aren't working, no idea why.</message>
  <tree>5b998a6a9e8ca6385747264be94226fcf8e89c1c</tree>
  <committer>
    <name>Michael Bleigh</name>
    <email>michael@intridea.com</email>
  </committer>
</commit>
