<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>generators/scaffold_resource/templates/old_migration.rb</filename>
    </added>
    <added>
      <filename>generators/scaffold_resource/templates/view__form.erb</filename>
    </added>
    <added>
      <filename>generators/scaffold_resource/templates/view_edit.erb</filename>
    </added>
    <added>
      <filename>generators/scaffold_resource/templates/view_index.erb</filename>
    </added>
    <added>
      <filename>generators/scaffold_resource/templates/view_new.erb</filename>
    </added>
    <added>
      <filename>generators/scaffold_resource/templates/view_show.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
-Copyright (c) 2007 James Golick
+Copyright (c) 2008 James Golick
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation</diff>
      <filename>LICENSE</filename>
    </modified>
    <modified>
      <diff>@@ -3,12 +3,6 @@
 resource_controller makes RESTful controllers easier, more maintainable, and super readable.  With the RESTful controller pattern hidden away, you can focus on what makes your controller special.
 
 == Get It
-  
-resource_controller is currently available in two streams:
-
-=== 1.2.3+ Compatible
-
-Install it:
 
   svn export http://svn.jamesgolick.com/resource_controller/tags/stable vendor/plugins/resource_controller
   
@@ -16,20 +10,6 @@ SVN (stable): {http://svn.jamesgolick.com/resource_controller/tags/stable}[http:
 
 SVN (ongoing): {http://svn.jamesgolick.com/resource_controller/trunk}[http://svn.jamesgolick.com/resource_controller/trunk]
 
-  Note: If you want to run the tests, cd in to the test directory, and type rake test.
-
-=== Edge/Rails 2.0 Compatible
-
-Install it:
-
-  svn export http://svn.jamesgolick.com/resource_controller/tags/edge_compatible/stable vendor/plugins/resource_controller
-  
-SVN (stable): {http://svn.jamesgolick.com/resource_controller/tags/edge_compatible/stable}[http://svn.jamesgolick.com/resource_controller/tags/edge_compatible/stable]
-
-SVN (ongoing): {http://svn.jamesgolick.com/resource_controller/branches/edge_compatible}[http://svn.jamesgolick.com/resource_controller/branches/edge_compatible]
-
-  Note: If you want to run the tests in the edge-compatible version, cd in to the test directory, and type rake rails:freeze:edge, and then rake test.
-
 = Usage
 
 Creating a basic RESTful controller is as easy as...</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -20,3 +20,36 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
   rdoc.rdoc_files.include('README')
   rdoc.rdoc_files.include('lib/**/*.rb')
 end
+
+desc &quot;Do all necessary tagging for a release&quot;
+task :release =&gt; [:tag_release, :upload_docs]
+
+task :tag_release do
+  unless ENV.include?('human') &amp;&amp; ENV.include?('tag')
+    raise &quot;Usage: rake release human=0.something tag=rel_2.0&quot;
+  end
+
+  tag_name   = ENV['tag']
+  human_name = ENV['human']
+  repo_root  = &quot;http://svn.jamesgolick.com/resource_controller&quot;
+
+  puts &quot;tagging #{human_name}&quot;
+  `svn copy #{repo_root}/trunk #{repo_root}/tags/#{tag_name} -m&quot;tagging #{human_name}&quot;`
+
+  puts &quot;deleting previous stable tags&quot;
+  `svn rm #{repo_root}/tags/stable -m&quot;deleting previous stable tags&quot;`
+
+  puts &quot;tag stable release&quot;
+  `svn copy #{repo_root}/tags/#{tag_name} #{repo_root}/tags/stable -m&quot;tag stable release&quot;`
+end
+
+task :upload_docs =&gt; :rdoc do
+  puts 'Deleting previous rdoc'
+  `ssh jamesgolick.com 'rm -Rf /home/apps/jamesgolick.com/public/resource_controller/rdoc'`
+  
+  puts &quot;Uploading current rdoc&quot;
+  `scp -r rdoc jamesgolick.com:/home/apps/jamesgolick.com/public/resource_controller`
+  
+  puts &quot;Deleting rdoc&quot;
+  `rm -Rf rdoc`
+end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -39,11 +39,18 @@ class ScaffoldResourceGenerator &lt; Rails::Generator::NamedBase
       m.directory(File.join('test/functional', controller_class_path))
       m.directory(File.join('test/unit', class_path))
       
-      for action in scaffold_views
-        template_ext = (defined? Haml )? &quot;haml&quot; : &quot;rhtml&quot;
-
+      generator_template_ext = (defined? Haml )? &quot;haml&quot; : &quot;erb&quot;
+      
+      # we want to call erb templates .rhtml or .haml if this is rails 1
+      if RAILS_GEM_VERSION.to_i == 1
+        template_ext = generator_template_ext == 'erb' ? 'rhtml' : generator_template_ext
+      else
+        template_ext = &quot;html.#{generator_template_ext}&quot;
+      end
+      
+      scaffold_views.each do |action|
         m.template(
-          &quot;view_#{action}.#{template_ext}&quot;,
+          &quot;view_#{action}.#{generator_template_ext}&quot;,
           File.join('app/views', controller_class_path, controller_file_name, &quot;#{action}.#{template_ext}&quot;)
         )
       end
@@ -62,8 +69,10 @@ class ScaffoldResourceGenerator &lt; Rails::Generator::NamedBase
       m.template('fixtures.yml',       File.join('test/fixtures', &quot;#{table_name}.yml&quot;))
 
       unless options[:skip_migration]
+        migration_template = RAILS_GEM_VERSION.to_i == 1 ? 'old_migration.rb' : 'migration.rb'
+        
         m.migration_template(
-          'migration.rb', 'db/migrate', 
+          migration_template, 'db/migrate', 
           :assigns =&gt; {
             :migration_name =&gt; &quot;Create#{class_name.pluralize.gsub(/::/, '')}&quot;,
             :attributes     =&gt; attributes</diff>
      <filename>generators/scaffold_resource/scaffold_resource_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,10 @@ class &lt;%= migration_name %&gt; &lt; ActiveRecord::Migration
   def self.up
     create_table :&lt;%= table_name %&gt;, :force =&gt; true do |t|
 &lt;% for attribute in attributes -%&gt;
-      t.column :&lt;%= attribute.name %&gt;, :&lt;%= attribute.type %&gt;
+      t.&lt;%= attribute.type %&gt; :&lt;%= attribute.name %&gt;
 &lt;% end -%&gt;
+
+      t.timestamps
     end
   end
 </diff>
      <filename>generators/scaffold_resource/templates/migration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -100,13 +100,13 @@ module ResourceController::Helpers::Urls
     # Used internally to provide the options to smart_url from Urligence.
     #
     def object_url_options(action_prefix = nil, alternate_object = nil)
-      namespaces + [*parent_url_options] + [action_prefix, [route_name.to_sym, alternate_object || object]]
+      [action_prefix] + namespaces + [parent_url_options, [route_name.to_sym, alternate_object || object]]
     end
     
     # Used internally to provide the options to smart_url from Urligence.
     #
     def new_object_url_options
-      namespaces + [*parent_url_options] + [:new, route_name.to_sym]
+      [:new] + namespaces + [parent_url_options, route_name.to_sym]
     end
     
     def parent_url_options</diff>
      <filename>lib/resource_controller/helpers/urls.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,5 +3,5 @@
 
 class ApplicationController &lt; ActionController::Base
   # Pick a unique cookie name to distinguish our session data from others'
-  session :session_key =&gt; '_test_session_id'
+  session :session_key =&gt; '_myapp_session'
 end</diff>
      <filename>test/app/controllers/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
 
 &lt;%= error_messages_for :product %&gt;
 
-&lt;% form_for(:product, :url =&gt; smart_url(:cms, @product), :html =&gt; { :method =&gt; :put }) do |f| %&gt;
+&lt;% form_for(:product, :url =&gt; object_url, :html =&gt; { :method =&gt; :put }) do |f| %&gt;
   &lt;p&gt;
     &lt;b&gt;Name&lt;/b&gt;&lt;br /&gt;
     &lt;%= f.text_field :name %&gt;
@@ -13,5 +13,5 @@
   &lt;/p&gt;
 &lt;% end %&gt;
 
-&lt;%= link_to 'Show', smart_url(:cms, @product) %&gt; |
-&lt;%= link_to 'Back', smart_url(:cms, :products) %&gt;
\ No newline at end of file
+&lt;%= link_to 'Show', object_url %&gt; |
+&lt;%= link_to 'Back', collection_url %&gt;
\ No newline at end of file</diff>
      <filename>test/app/views/cms/products/edit.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -8,13 +8,13 @@
 &lt;% for product in @products %&gt;
   &lt;tr&gt;
     &lt;td&gt;&lt;%=h product.name %&gt;&lt;/td&gt;
-    &lt;td&gt;&lt;%= link_to 'Show', smart_url(:cms, product) %&gt;&lt;/td&gt;
-    &lt;td&gt;&lt;%= link_to 'Edit', smart_url(:cms, :edit, product) %&gt;&lt;/td&gt;
-    &lt;td&gt;&lt;%= link_to 'Destroy', smart_url(:cms, product), :confirm =&gt; 'Are you sure?', :method =&gt; :delete %&gt;&lt;/td&gt;
+    &lt;td&gt;&lt;%= link_to 'Show', object_url(product) %&gt;&lt;/td&gt;
+    &lt;td&gt;&lt;%= link_to 'Edit', edit_object_url(product) %&gt;&lt;/td&gt;
+    &lt;td&gt;&lt;%= link_to 'Destroy', object_url(product), :confirm =&gt; 'Are you sure?', :method =&gt; :delete %&gt;&lt;/td&gt;
   &lt;/tr&gt;
 &lt;% end %&gt;
 &lt;/table&gt;
 
 &lt;br /&gt;
 
-&lt;%= link_to 'New product', smart_url(:cms, :new, :product) %&gt;
\ No newline at end of file
+&lt;%= link_to 'New product', new_object_url %&gt;
\ No newline at end of file</diff>
      <filename>test/app/views/cms/products/index.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
 
 &lt;%= error_messages_for :product %&gt;
 
-&lt;% form_for(:product, :url =&gt; smart_url(:cms, :products)) do |f| %&gt;
+&lt;% form_for(:product, :url =&gt; collection_url) do |f| %&gt;
   &lt;p&gt;
     &lt;b&gt;Name&lt;/b&gt;&lt;br /&gt;
     &lt;%= f.text_field :name %&gt;
@@ -13,4 +13,4 @@
   &lt;/p&gt;
 &lt;% end %&gt;
 
-&lt;%= link_to 'Back', smart_url(:cms, :products) %&gt;
\ No newline at end of file
+&lt;%= link_to 'Back', collection_url %&gt;
\ No newline at end of file</diff>
      <filename>test/app/views/cms/products/new.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -4,5 +4,5 @@
 &lt;/p&gt;
 
 
-&lt;%= link_to 'Edit', smart_url(:cms, :edit, @product) %&gt; |
-&lt;%= link_to 'Back', smart_url(:cms, :products) %&gt;
\ No newline at end of file
+&lt;%= link_to 'Edit', edit_object_url %&gt; |
+&lt;%= link_to 'Back', collection_url %&gt;
\ No newline at end of file</diff>
      <filename>test/app/views/cms/products/show.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 # ENV['RAILS_ENV'] ||= 'production'
 
 # Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '1.2.6' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
 
 # Bootstrap the Rails environment, frameworks, and default configuration
 require File.join(File.dirname(__FILE__), 'boot')
@@ -42,6 +42,8 @@ Rails::Initializer.run do |config|
   # config.active_record.default_timezone = :utc
   
   # See Rails::Configuration for more options
+  
+  config.action_controller.session = { :session_key =&gt; &quot;_myapp_session&quot;, :secret =&gt; &quot;some secret phrase&quot; }
 end
 
 require &quot;#{RAILS_ROOT}/../init&quot;</diff>
      <filename>test/config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,9 +18,9 @@ ActionController::Routing::Routes.draw do |map|
   end
   
   map.resources :tags
-
-  map.resources :products, :name_prefix =&gt; &quot;cms_&quot; do |product|
-    product.resources :options, :name_prefix =&gt; &quot;cms_product_&quot;
+  
+  map.namespace :cms do |cms|
+    cms.resources :products, :has_many =&gt; :options
   end
 
   map.resources :posts do |post|</diff>
      <filename>test/config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,41 +1,61 @@
-# This file is autogenerated. Instead of editing this file, please use the
-# migrations feature of ActiveRecord to incrementally modify your database, and
+# This file is auto-generated from the current state of the database. Instead of editing this file, 
+# please use the migrations feature of ActiveRecord to incrementally modify your database, and
 # then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your database schema. If you need
+# to create the application database on another system, you should be using db:schema:load, not running
+# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
 
 ActiveRecord::Schema.define(:version =&gt; 11) do
 
   create_table &quot;accounts&quot;, :force =&gt; true do |t|
-    t.column &quot;name&quot;, :string
+    t.string &quot;name&quot;
   end
 
   create_table &quot;comments&quot;, :force =&gt; true do |t|
-    t.column &quot;post_id&quot;, :integer
-    t.column &quot;author&quot;,  :string
-    t.column &quot;body&quot;,    :text
+    t.integer &quot;post_id&quot;
+    t.string  &quot;author&quot;
+    t.text    &quot;body&quot;
   end
 
   create_table &quot;options&quot;, :force =&gt; true do |t|
-    t.column &quot;product_id&quot;, :integer
-    t.column &quot;title&quot;,      :string
+    t.integer &quot;product_id&quot;
+    t.string  &quot;title&quot;
   end
 
   create_table &quot;photos&quot;, :force =&gt; true do |t|
-    t.column &quot;title&quot;,      :string
-    t.column &quot;account_id&quot;, :integer
+    t.string  &quot;title&quot;
+    t.integer &quot;account_id&quot;
   end
 
   create_table &quot;photos_tags&quot;, :force =&gt; true do |t|
-    t.column &quot;photo_id&quot;, :integer
-    t.column &quot;tag_id&quot;,   :integer
+    t.integer &quot;photo_id&quot;
+    t.integer &quot;tag_id&quot;
   end
 
   create_table &quot;posts&quot;, :force =&gt; true do |t|
-    t.column &quot;title&quot;, :string, :default =&gt; &quot;&quot;
-    t.column &quot;body&quot;,  :text
+    t.string &quot;title&quot;, :default =&gt; &quot;&quot;
+    t.text   &quot;body&quot;
   end
 
   create_table &quot;products&quot;, :force =&gt; true do |t|
-    t.column &quot;name&quot;, :string
+    t.string &quot;name&quot;
+  end
+
+  create_table &quot;projects&quot;, :force =&gt; true do |t|
+    t.string &quot;title&quot;
+  end
+
+  create_table &quot;ratings&quot;, :force =&gt; true do |t|
+    t.integer &quot;comment_id&quot;
+    t.integer &quot;stars&quot;
+  end
+
+  create_table &quot;somethings&quot;, :force =&gt; true do |t|
+    t.string &quot;title&quot;
   end
 
   create_table &quot;projects&quot;, :force =&gt; true do |t|
@@ -52,7 +72,7 @@ ActiveRecord::Schema.define(:version =&gt; 11) do
   end
 
   create_table &quot;tags&quot;, :force =&gt; true do |t|
-    t.column &quot;name&quot;, :string
+    t.string &quot;name&quot;
   end
 
 end</diff>
      <filename>test/db/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,7 +48,7 @@ class PhotosControllerTest &lt; Test::Unit::TestCase
       should_assign_to :photo
       should_assign_to :user
       should &quot;scope photo to user&quot; do
-        assert accounts :one, assigns(:photo).user
+        assert accounts(:one), assigns(:photo).user
       end
     end
   end</diff>
      <filename>test/test/functional/photos_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,10 @@ class TagsControllerTest &lt; Test::Unit::TestCase
       should_assign_to :products
       should_render_template &quot;index&quot;
       should_respond_with :success
+      
+      should &quot;respond with html&quot; do
+        assert_equal 'text/html', @response.content_type
+      end
     end
     
     context &quot;xhr to :index&quot; do
@@ -29,8 +33,11 @@ class TagsControllerTest &lt; Test::Unit::TestCase
       end
 
       should_assign_to :products
-      should_render_template &quot;index.rjs&quot;
       should_respond_with :success
+
+      should &quot;respond with rjs&quot; do
+        assert_equal 'text/javascript', @response.content_type
+      end
     end
     
     context &quot;post to create&quot; do</diff>
      <filename>test/test/functional/tags_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+$:.reject! { |path| path.include? 'TextMate' }
 ENV[&quot;RAILS_ENV&quot;] = &quot;test&quot;
 require File.expand_path(File.dirname(__FILE__) + &quot;/../config/environment&quot;)
 require 'test_help'</diff>
      <filename>test/test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,16 +37,16 @@ class Helpers::UrlsTest &lt; Test::Unit::TestCase
     end
     
     should &quot;return the correct object options for a namespaced controller&quot; do
-      assert_equal [:cms, nil, nil, [:product, @product]], @products_controller.send(:object_url_options)
+      assert_equal [nil, :cms, nil, [:product, @product]], @products_controller.send(:object_url_options)
     end
     
     should &quot;return the correct object options when passed an action&quot; do
-      assert_equal [:cms, nil, :edit, [:product, @product]], @products_controller.send(:object_url_options, :edit)
+      assert_equal [:edit, :cms, nil, [:product, @product]], @products_controller.send(:object_url_options, :edit)
     end
     
     should &quot;accept an alternate object when passed one&quot; do
       p = Product.new
-      assert_equal [:cms, nil, nil, [:product, p]], @products_controller.send(:object_url_options, nil, p)
+      assert_equal [nil, :cms, nil, [:product, p]], @products_controller.send(:object_url_options, nil, p)
     end
     
     context &quot;with parent&quot; do
@@ -59,7 +59,7 @@ class Helpers::UrlsTest &lt; Test::Unit::TestCase
 
       should &quot;return the correct object options for object_url_options&quot; do
         @controller.expects(:object).returns @object
-        assert_equal [[:user, @user], :edit, [:post, @object]], @controller.send(:object_url_options, :edit)
+        assert_equal [:edit, [:user, @user], [:post, @object]], @controller.send(:object_url_options, :edit)
       end
       
       should &quot;return the correct object options for collection&quot; do</diff>
      <filename>test/test/unit/helpers/urls_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,5 +22,4 @@ class HelpersTest &lt; Test::Unit::TestCase
       end
     end
   end
-  
 end</diff>
      <filename>test/test/unit/helpers_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>generators/scaffold_resource/templates/view__form.rhtml</filename>
    </removed>
    <removed>
      <filename>generators/scaffold_resource/templates/view_edit.rhtml</filename>
    </removed>
    <removed>
      <filename>generators/scaffold_resource/templates/view_index.rhtml</filename>
    </removed>
    <removed>
      <filename>generators/scaffold_resource/templates/view_new.rhtml</filename>
    </removed>
    <removed>
      <filename>generators/scaffold_resource/templates/view_show.rhtml</filename>
    </removed>
    <removed>
      <filename>release.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>34add5d478a6c0cda4dc13948e9438fb35fa6299</id>
    </parent>
  </parents>
  <author>
    <name>james</name>
    <email>james@a0c33c4f-3f3c-0410-8ba4-d3650ac1a399</email>
  </author>
  <url>http://github.com/jamesgolick/resource_controller/commit/3cd4f285f6e022e36840ad0c901b2acc38ebc77c</url>
  <id>3cd4f285f6e022e36840ad0c901b2acc38ebc77c</id>
  <committed-date>2008-02-15T13:54:01-08:00</committed-date>
  <authored-date>2008-02-15T13:54:01-08:00</authored-date>
  <message>merge back from trunk so that deep_nesting reflects the lack of edge_compatible branches


git-svn-id: http://svn.jamesgolick.com/resource_controller/branches/deep_nesting@158 a0c33c4f-3f3c-0410-8ba4-d3650ac1a399</message>
  <tree>029b80326b0ad901154a20b80abac5c296f033a1</tree>
  <committer>
    <name>james</name>
    <email>james@a0c33c4f-3f3c-0410-8ba4-d3650ac1a399</email>
  </committer>
</commit>
