<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -6,7 +6,9 @@ class SchemaBrowser
   attr_reader :tables, :relations
 
   def initialize
-    @tables = SchemaBrowser.get_tables_from_connection.map { |table_name| SchemaTable.new(table_name) }
+    @tables = SchemaBrowser.get_tables_from_connection.map do |table_name|
+      SchemaTable.new(table_name)
+    end
     @tables.each do |table|
       table.gather_relations
     end</diff>
      <filename>lib/schema_browser.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,9 +7,9 @@ class SchemaTable
   def initialize(table_name)
     @table_id = get_id
     @name = table_name
-    @columns = ActiveRecord::Base.connection.columns(table_name).map { |c| SchemaColumn.new(c) }
     @relations = []
     @@tables[table_name] = self
+    @columns = ActiveRecord::Base.connection.columns(table_name).map { |c| SchemaColumn.new(c) }
     set_indexes
     set_primary_key
   end
@@ -55,7 +55,9 @@ class SchemaTable
     @indexes.each do |index|
       column_name = get_column_name_from_index_name(index.name)
       if column_name
-        column(column_name).index = true
+        if column(column_name)
+          column(column_name).index = true
+        end
       end
     end
   end</diff>
      <filename>lib/schema_table.rb</filename>
    </modified>
    <modified>
      <diff>@@ -26,7 +26,7 @@ describe SchemaTable do
     add_relation(&quot;parrot&quot;, &quot;pirate&quot;)
 
     add_mock_index(&quot;pirates&quot;, &quot;name&quot;)
-
+    add_mock_index(&quot;parrots&quot;, &quot;non_existing_column&quot;) # FIXME: this should be done just in the test that checks for error on non existing column
   end
 
   before(:each) do
@@ -162,6 +162,12 @@ describe SchemaTable do
     end
   end
 
+  it &quot;should not generate an error if the column inferred from an index does not exist&quot; do
+    lambda {
+      SchemaTable.new(&quot;parrots&quot;)
+    }.should_not raise_error
+  end
+
   def stub_table(table_name, instantiate = true)
     @relations[table_name] ||= []
     return unless instantiate</diff>
      <filename>spec/lib/schema_table_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c8a2e441f0b2f4879769dbd31b20b95470f2cc8e</id>
    </parent>
  </parents>
  <author>
    <name>Tom ten Thij</name>
    <email>git@tomtenthij.nl</email>
  </author>
  <url>http://github.com/tomtt/schema-browser/commit/804ac0d7ba39a6e24182a99a4c5c83ee9c1dc163</url>
  <id>804ac0d7ba39a6e24182a99a4c5c83ee9c1dc163</id>
  <committed-date>2008-02-18T06:20:54-08:00</committed-date>
  <authored-date>2008-02-18T06:20:54-08:00</authored-date>
  <message>fixed error when column inferred from index does not exist</message>
  <tree>5a72cde2b409458b3cd4cc043752840d9076fd86</tree>
  <committer>
    <name>Tom ten Thij</name>
    <email>git@tomtenthij.nl</email>
  </committer>
</commit>
