<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -33,7 +33,8 @@ module RPH
       #   &lt;%= f.select :category_id, Category.options_for_select -%&gt;
       def options_for_select
         rows = self.find(:all, :conditions =&gt; (options[:conditions] || {}), :order =&gt; options[:order])
-        [[options[:default_text], nil]] + rows.collect { |r| [r.send(field_to_select), r.id] }
+        default_selection = (options[:default_text] == :first ? [] : [[options[:default_text], nil]])
+        default_selection + rows.collect { |r| [r.send(field_to_select), r.id] }
       end
     end
   </diff>
      <filename>lib/acts_as_lookup.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,70 +1,82 @@
 require File.join(File.dirname(__FILE__), 'spec_helper')
 
-class TestModel &lt; MockAR::Base
+class Basic &lt; MockAR::Base
   acts_as_lookup :title
 end
 
-class Other &lt; MockAR::Base
+class Customized &lt; MockAR::Base
   acts_as_lookup :title, :default_text =&gt; '-- Choose --', :conditions =&gt; 'id &lt;&gt; 3', :order =&gt; 'id DESC'
 end
 
+class DefaultToFirstOption &lt; MockAR::Base
+  acts_as_lookup :title, :default_text =&gt; :first
+end
+
 describe &quot;ActsAsLookup&quot; do
   E = RPH::ActsAsLookup::Error
   
   before(:each) do
-    @tm = TestModel
+    @basic = Basic
   end
   
   describe &quot;Models&quot; do
     it &quot;should respond to `acts_as_lookup'&quot; do
-      @tm.should respond_to(:acts_as_lookup)
+      @basic.should respond_to(:acts_as_lookup)
     end
   
     it &quot;should respond to `options_for_select'&quot; do
-      @tm.should respond_to(:options_for_select)
+      @basic.should respond_to(:options_for_select)
+    end
+    
+    it &quot;should have 4 items in the array&quot; do
+      @basic.options_for_select.size.should eql(4)
     end
     
     it &quot;should respond to `field_to_select'&quot; do
-      @tm.should respond_to(:field_to_select)
+      @basic.should respond_to(:field_to_select)
     end
     
     it &quot;should have field_to_select set to 'title'&quot; do
-      @tm.field_to_select.should eql(:title)
+      @basic.field_to_select.should eql(:title)
     end
     
     describe &quot;default options&quot; do
       it &quot;should have no conditions by default&quot; do
-        @tm.options[:conditions].should be_nil
+        @basic.options[:conditions].should be_nil
       end
       
       it &quot;should have default text of '--' for first select item&quot; do
-        @tm.options[:default_text].should_not be_nil
-        @tm.options[:default_text].should eql('--')
+        @basic.options[:default_text].should_not be_nil
+        @basic.options[:default_text].should eql('--')
       end
     
       it &quot;should have default order of field_to_select (for alphabetical list)&quot; do
-        @tm.options[:order].should_not be_nil
-        @tm.options[:order].should eql(@tm.field_to_select.to_s)
+        @basic.options[:order].should_not be_nil
+        @basic.options[:order].should eql(@basic.field_to_select.to_s)
       end
     end
     
     describe &quot;customization&quot; do      
       before(:each) do
-        @other = Other
+        @customized = Customized
       end
       
       it &quot;should support custom text for the first select entry&quot; do
-        @other.options_for_select.first[0].should eql('-- Choose --')
+        @customized.options_for_select.first[0].should eql('-- Choose --')
       end
     
       it &quot;should support custom conditions for SQL&quot; do
-        @other.options[:conditions].should_not be_nil
-        @other.options[:conditions].should eql('id &lt;&gt; 3')
+        @customized.options[:conditions].should_not be_nil
+        @customized.options[:conditions].should eql('id &lt;&gt; 3')
       end
     
       it &quot;should support custom order for SQL&quot; do
-        @other.options[:order].should_not be_nil
-        @other.options[:order].should eql('id DESC')
+        @customized.options[:order].should_not be_nil
+        @customized.options[:order].should eql('id DESC')
+      end
+      
+      it &quot;should not add the default 'nil' option if :default_text set to :first&quot; do
+        DefaultToFirstOption.options_for_select.size.should eql(3)
       end
     end
   end
@@ -81,8 +93,8 @@ describe &quot;ActsAsLookup&quot; do
     end
     
     it &quot;`lookup_for' should act the same as regular select&quot; do
-      ActionView::Base.new.lookup_for(:other, :test_model_id).
-        should eql(select(:other, :test_model_id, TestModel.options_for_select))
+      ActionView::Base.new.lookup_for(:other, :basic_id).
+        should eql(select(:other, :basic_id, Basic.options_for_select))
     end
   end
   </diff>
      <filename>spec/acts_as_lookup_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>33fcdfb55e0f9855491e6975a0a8ba4e633a7c4a</id>
    </parent>
  </parents>
  <author>
    <name>rpheath</name>
    <email>rpheath@gmail.com</email>
  </author>
  <url>http://github.com/rpheath/acts_as_lookup/commit/340a534f0a3cf003dfe50cfd19fc9c480d32e507</url>
  <id>340a534f0a3cf003dfe50cfd19fc9c480d32e507</id>
  <committed-date>2008-05-05T05:01:29-07:00</committed-date>
  <authored-date>2008-05-05T05:01:29-07:00</authored-date>
  <message>added ability to override nil option</message>
  <tree>d4d118e621b605312bd5397df98ec26f8c5e2b67</tree>
  <committer>
    <name>rpheath</name>
    <email>rpheath@gmail.com</email>
  </committer>
</commit>
