<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,2 +1,4 @@
 log/*
-tmp/*
\ No newline at end of file
+tmp/*
+db/*.sqlite3
+.idea/*</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -3,8 +3,35 @@
 ## How to install Rails
   
       sudo gem install rails
-      sudo gem install rspec-rails
-  
+
 ## Create the application
     
-      rails url_shortener
\ No newline at end of file
+      rails url_shortener
+
+## Install the RSpec-Rails gem
+
+Edit environments/test.rb and add the following
+
+&lt;script src=&quot;http://gist.github.com/122558.js&quot;&gt;&lt;/script&gt;
+
+Then run
+  
+    rake gems:install RAILS_ENV=test
+    script/generate rspec
+
+### _If you are using Rubymine_
+* Go to Project Settings &gt; Ruby SDK and Gems
+* Click 'Attach gems'
+  * Add Rspec
+  * Add Rspec-rails
+        
+## Generate the Url model
+
+    script/generate rspec_model Url
+
+### Modify the generated migration to create the database schema
+&lt;script src=&quot;http://gist.github.com/122577.js&quot;&gt;&lt;/script&gt;
+
+    rake db:migrate db:test:prepare
+
+### Modify the generated model spec. Add tests for your model.
\ No newline at end of file</diff>
      <filename>README.mdown</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,13 @@
 class Url &lt; ActiveRecord::Base
   validates_presence_of :location
-  # YOu probably want to use a real regex here
+  # You probably want to use a real regex here
   validates_format_of :location, :with =&gt; /^http[s]?:\/\//, :message =&gt; 'Location must be a valid Url.', :if =&gt; :location
+
+  after_create :generate_slug
+
+  private
+
+  def generate_slug
+    update_attribute(:slug, id.to_s(36))
+  end
 end</diff>
      <filename>app/models/url.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,35 +7,5 @@ RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
 require File.join(File.dirname(__FILE__), 'boot')
 
 Rails::Initializer.run do |config|
-  # Settings in config/environments/* take precedence over those specified here.
-  # Application configuration should go into files in config/initializers
-  # -- all .rb files in that directory are automatically loaded.
-
-  # Add additional load paths for your own custom dirs
-  # config.load_paths += %W( #{RAILS_ROOT}/extras )
-
-  # Specify gems that this application depends on and have them installed with rake gems:install
-  # config.gem &quot;bj&quot;
-  # config.gem &quot;hpricot&quot;, :version =&gt; '0.6', :source =&gt; &quot;http://code.whytheluckystiff.net&quot;
-  # config.gem &quot;sqlite3-ruby&quot;, :lib =&gt; &quot;sqlite3&quot;
-  # config.gem &quot;aws-s3&quot;, :lib =&gt; &quot;aws/s3&quot;
-
-  # Only load the plugins named here, in the order given (default is alphabetical).
-  # :all can be used as a placeholder for all plugins not explicitly named
-  # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
-  # Skip frameworks you're not going to use. To use Rails without a database,
-  # you must remove the Active Record framework.
-  # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
-
-  # Activate observers that should always be running
-  # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
-
-  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
-  # Run &quot;rake -D time&quot; for a list of tasks for finding time zone names.
   config.time_zone = 'UTC'
-
-  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
-  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
-  # config.i18n.default_locale = :de
 end
\ No newline at end of file</diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,4 +25,7 @@ config.action_mailer.delivery_method = :test
 # Use SQL instead of Active Record's schema dumper when creating the test database.
 # This is necessary if your schema can't be completely dumped by the schema dumper,
 # like if you have constraints or database-specific column types
-# config.active_record.schema_format = :sql
\ No newline at end of file
+# config.active_record.schema_format = :sql
+
+config.gem &quot;rspec&quot;, :version =&gt; &quot;&gt;= 1.2.6&quot;, :lib =&gt; 'spec'
+config.gem &quot;rspec-rails&quot;, :version =&gt; &quot;&gt;= 1.2.6&quot;, :lib =&gt; 'spec/rails'</diff>
      <filename>config/environments/test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,4 +20,11 @@ describe Url do
       @url.should have(1).error_on(:location)
     end
   end
+
+  describe &quot;after save&quot; do
+    it &quot;should set the url slug&quot; do
+      @url.save!
+      @url.slug.should_not be_blank
+    end
+  end
 end</diff>
      <filename>spec/models/url_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a9bb339c9715156f515842f48017f2576cdd70f5</id>
    </parent>
  </parents>
  <author>
    <name>Britt Crawford</name>
    <email>britt@illtemper.org</email>
  </author>
  <url>http://github.com/britt/tech-talk/commit/efe3223114e32e9c1e287a53f6577719ad09d177</url>
  <id>efe3223114e32e9c1e287a53f6577719ad09d177</id>
  <committed-date>2009-06-02T15:08:52-07:00</committed-date>
  <authored-date>2009-06-02T15:08:52-07:00</authored-date>
  <message>Added URL slug generation</message>
  <tree>63bc42f3de1fda5758be2707b14aaed2193582a0</tree>
  <committer>
    <name>Britt Crawford</name>
    <email>britt@illtemper.org</email>
  </committer>
</commit>
