<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -116,6 +116,16 @@ end
 
 And of course, you could pass all options at once. I've just shown them separately to focus on each point. Enjoy.
 
+h4. Multiple Fields
+
+Let's say you have 'first_name' and 'last_name' columns in your users table. You may want to display the full name in the selection box. Well, if you pass an array to the @acts_as_lookup@ helper, it will automatically construct the selection text. It also validates that each of the attrs exist, so make sure they do :-)
+
+&lt;pre&gt;&lt;/code&gt;
+class Category &lt; ActiveRecord::Base
+  acts_as_lookup [:first_name, :last_name]
+end
+&lt;/pre&gt;&lt;/code&gt;
+
 h2. License
 
 Copyright (c) 2008 Ryan Heath, released under the MIT license
\ No newline at end of file</diff>
      <filename>README.textile</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,20 @@
 module RPH
   module ActsAsLookup
+    module Error
+      class CustomError &lt; RuntimeError
+        def self.message(msg=nil); msg.nil? ? @message : self.message = msg; end
+        def self.message=(msg); @message = msg; end
+      end
+      
+      # custom error classes
+      class InvalidAttr &lt; CustomError
+        message &quot;attr passed to `acts_as_lookup' does not exist&quot;; end
+      class InvalidLookup &lt; CustomError
+        message &quot;model passed to `lookup_for' does not have the `act_as_lookup' declaration&quot;; end
+      class InvalidModel &lt; CustomError
+        message &quot;model passed to `lookup_for' does not seem to exist&quot;; end
+    end
+    
     def self.included(base)
       base.extend ActMethods
     end
@@ -9,19 +24,24 @@ module RPH
       #   class Category &lt; ActiveRecord::Base
       #     acts_as_lookup :title
       #   end
+      #
+      #   class User &lt; ActiveRecord::Base
+      #     acts_as_lookup [:first_name, :last_name]
+      #   end
       def acts_as_lookup(field_to_select, optionz={})
-        raise(Error::InvalidAttr, Error::InvalidAttr.message) unless self.new.respond_to?(field_to_select)
+        valid_attributes = [field_to_select].flatten.all? { |attr| self.new.respond_to?(attr) }
+        raise(Error::InvalidAttr, Error::InvalidAttr.message) unless valid_attributes
         
         options = {
           :default_text =&gt; '--',
-          :order =&gt; &quot;#{field_to_select.to_s}&quot;
+          :order =&gt; [field_to_select].flatten.compact.join(',')
         }.merge!(optionz)
       
-        class_inheritable_accessor :options, :field_to_select
+        class_inheritable_accessor :options, :field_to_select, :selection_text
         extend ClassMethods
       
         self.options = options
-        self.field_to_select = field_to_select.to_sym
+        self.field_to_select = field_to_select
       end
     end
   
@@ -34,7 +54,14 @@ module RPH
       def options_for_select
         rows = self.find(:all, :conditions =&gt; (options[:conditions] || {}), :order =&gt; options[:order])
         default_selection = (options[:default_text] == :first ? [] : [[options[:default_text], nil]])
-        default_selection + rows.collect { |r| [r.send(field_to_select), r.id] }
+        default_selection + rows.collect do |r| 
+          [
+            field_to_select.is_a?(Array) ? 
+              field_to_select.inject([]) { |attrs, attr| attrs &lt;&lt; r.send(attr) }.compact.join(' ') : 
+                r.send(field_to_select), 
+            r.id
+          ]
+        end
       end
     end
   
@@ -71,7 +98,7 @@ module RPH
         rescue NameError
           raise(Error::InvalidModel, Error::InvalidModel.message)
         end
-        raise(Error::InvalidLookup, Error::InvalidLookup.message) unless klass &amp;&amp; klass.respond_to?(:field_to_select) &amp;&amp; klass.respond_to?(:options_for_select)
+        raise(Error::InvalidLookup, Error::InvalidLookup.message) unless klass &amp;&amp; klass.respond_to?(:options_for_select)
         select(obj.to_sym, f_key.to_sym, klass.options_for_select, options, html_options)
       end
       
@@ -88,21 +115,5 @@ module RPH
         end
       end
     end
-    
-    # error module to raise plugin specific errors
-    module Error
-      class CustomError &lt; RuntimeError
-        def self.message(msg=nil); msg.nil? ? @message : self.message = msg; end
-        def self.message=(msg); @message = msg; end
-      end
-      
-      # custom error classes
-      class InvalidAttr &lt; CustomError
-        message &quot;attr passed to `acts_as_lookup' does not exist&quot;; end
-      class InvalidLookup &lt; CustomError
-        message &quot;model passed to `lookup_for' does not have the `act_as_lookup' declaration&quot;; end
-      class InvalidModel &lt; CustomError
-        message &quot;model passed to `lookup_for' does not seem to exist&quot;; end
-    end
   end
 end
\ No newline at end of file</diff>
      <filename>lib/acts_as_lookup.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8981071a11aaff2d584d5fcc16d5f0505d57f08f</id>
    </parent>
  </parents>
  <author>
    <name>rpheath</name>
    <email>rpheath@gmail.com</email>
  </author>
  <url>http://github.com/rpheath/acts_as_lookup/commit/ffea0659a2e527288f24721aa68829a8fdf1f5f7</url>
  <id>ffea0659a2e527288f24721aa68829a8fdf1f5f7</id>
  <committed-date>2009-03-19T11:10:55-07:00</committed-date>
  <authored-date>2009-03-19T11:10:55-07:00</authored-date>
  <message>added ability to pass multiple fields for selection text in drop downs (e.g. acts_as_lookup [:first_name, :last_name])</message>
  <tree>f683f046d225c05b0e3e2e3700ff0430e23fd432</tree>
  <committer>
    <name>rpheath</name>
    <email>rpheath@gmail.com</email>
  </committer>
</commit>
