<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,16 @@
 require 'rake'
 require 'rake/testtask'
 require 'rake/rdoctask'
+
+# Suppress file lists when running tests
+Rake::TestTask.class_eval do
+  alias_method :original_define, :define
+  def define
+    @verbose = false
+    original_define
+  end
+end
+
 require 'test/lib/ar_helper'
 load 'test/lib/multi_rails/tasks/multi_rails.rake'
 load 'tasks/rcov.rake'</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -37,6 +37,10 @@ class Streamlined::Column::ActiveRecord &lt; Streamlined::Column::Base
   def render_td_show(view, item)
     if enumeration
       content = item.send(self.name)
+      if enumeration.first.is_a?(Array)
+        key_value_pair = enumeration.detect { |e| e.last == content }
+        content = key_value_pair.first if key_value_pair
+      end
       content = content &amp;&amp; !content.blank? ? content : self.unassigned_value
       content = wrap_with_link(content, view, item)
     else
@@ -44,6 +48,11 @@ class Streamlined::Column::ActiveRecord &lt; Streamlined::Column::Base
     end
   end
   
+  def enumeration
+    # Convert the enumeration to a 2d array if it's a hash
+    @enumeration.is_a?(Hash) ? @enumeration.to_a : @enumeration
+  end
+  
   def render_td_list(view, item)
     id = relationship_div_id(name, item)
     div = render_td_show(view, item)</diff>
      <filename>lib/streamlined/column/active_record.rb</filename>
    </modified>
    <modified>
      <diff>@@ -136,7 +136,7 @@ describe &quot;Streamlined::Column::ActiveRecord&quot; do
     assert_equal &quot;Unassigned&quot;, @ar.render_td_show(@view, item)
   end
   
-  it &quot;render td with enumeration&quot; do
+  it &quot;render td with array-backed enumeration&quot; do
     setup_mocks
     @ar.enumeration = %w{ A B C }
     @view.should_receive(:crud_context).and_return(:list).once
@@ -144,6 +144,38 @@ describe &quot;Streamlined::Column::ActiveRecord&quot; do
     assert_equal expected, @ar.render_td(@view, @item)
   end
   
+  it &quot;render td with hash-backed enumeration&quot; do
+    setup_mocks(:column =&gt; 1)
+    @ar.enumeration = { &quot;A&quot; =&gt; 1, &quot;B&quot; =&gt; 2, &quot;C&quot; =&gt; 3 }
+    @view.should_receive(:crud_context).and_return(:list).once
+    expected = &quot;&lt;div id=\&quot;EnumerableSelect::column::123::\&quot;&gt;A&lt;/div&gt;link&quot;
+    assert_equal expected, @ar.render_td(@view, @item)
+  end
+  
+  it &quot;render td with hash-backed enumeration and nil column value&quot; do
+    setup_mocks(:column =&gt; nil)
+    @ar.enumeration = { &quot;A&quot; =&gt; 1, &quot;B&quot; =&gt; 2, &quot;C&quot; =&gt; 3 }
+    @view.should_receive(:crud_context).and_return(:list).once
+    expected = &quot;&lt;div id=\&quot;EnumerableSelect::column::123::\&quot;&gt;Unassigned&lt;/div&gt;link&quot;
+    assert_equal expected, @ar.render_td(@view, @item)
+  end
+  
+  it &quot;render td with 2d array-backed enumeration&quot; do
+    setup_mocks(:column =&gt; 1)
+    @ar.enumeration = [[&quot;A&quot;, 1], [&quot;B&quot;, 2], [&quot;C&quot;, 3]]
+    @view.should_receive(:crud_context).and_return(:list).once
+    expected = &quot;&lt;div id=\&quot;EnumerableSelect::column::123::\&quot;&gt;A&lt;/div&gt;link&quot;
+    assert_equal expected, @ar.render_td(@view, @item)
+  end
+  
+  it &quot;render td with 2d array-backed enumeration and nil column value&quot; do
+    setup_mocks(:column =&gt; nil)
+    @ar.enumeration = [[&quot;A&quot;, 1], [&quot;B&quot;, 2], [&quot;C&quot;, 3]]
+    @view.should_receive(:crud_context).and_return(:list).once
+    expected = &quot;&lt;div id=\&quot;EnumerableSelect::column::123::\&quot;&gt;Unassigned&lt;/div&gt;link&quot;
+    assert_equal expected, @ar.render_td(@view, @item)
+  end
+  
   it &quot;render td list with enumeration and link&quot; do
     setup_mocks
     @ar.enumeration = %w{ A B C }
@@ -223,8 +255,8 @@ private
     flexmock(:name =&gt; name, :human_name =&gt; human_name)
   end
   
-  def setup_mocks
+  def setup_mocks(item_attrs={})
     @view = flexmock(:controller_name =&gt; 'controller_name', :link_to_function =&gt; 'link')
-    @item = flexmock(:id =&gt; 123, :column =&gt; 'render')
+    @item = flexmock(item_attrs.reverse_merge(:id =&gt; 123, :column =&gt; 'render'))
   end
 end</diff>
      <filename>test/unit/streamlined/column/active_record_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4865d87f75e5ce2b830d47a57f3ca66d88b822f7</id>
    </parent>
  </parents>
  <author>
    <name>matthew</name>
    <email>matthew@4f249914-c612-0410-8deb-f4485a9d85ab</email>
  </author>
  <url>http://github.com/relevance/streamlined/commit/4311503142969d0a69774ffe7f45682e077def52</url>
  <id>4311503142969d0a69774ffe7f45682e077def52</id>
  <committed-date>2008-03-16T20:06:03-07:00</committed-date>
  <authored-date>2008-03-16T20:06:03-07:00</authored-date>
  <message>#140 fixed hash-backed enumerations so the correct value is displayed in the show/list views</message>
  <tree>f8d5ec0c18f7c7ce1468e08bc919ea74d6b4873e</tree>
  <committer>
    <name>matthew</name>
    <email>matthew@4f249914-c612-0410-8deb-f4485a9d85ab</email>
  </committer>
</commit>
