<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/enumerate_by.rb</filename>
    </added>
    <added>
      <filename>lib/enumerate_by/extensions/associations.rb</filename>
    </added>
    <added>
      <filename>lib/enumerate_by/extensions/base_conditions.rb</filename>
    </added>
    <added>
      <filename>lib/enumerate_by/extensions/serializer.rb</filename>
    </added>
    <added>
      <filename>lib/enumerate_by/extensions/xml_serializer.rb</filename>
    </added>
    <added>
      <filename>test/app_root/db/migrate/001_create_colors.rb</filename>
    </added>
    <added>
      <filename>test/app_root/db/migrate/002_create_cars.rb</filename>
    </added>
    <added>
      <filename>test/unit/enumerate_by_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,11 @@
 == master
 
+* Automatically trigger in-memory caching of the enumeration's table when bootstrapping
+* Add #bootstrap for automatically synchronizing the records in an enumeration's table
+* Improve serialization performance
+* No longer use tableless models
+* Re-brand under the enumerate_by name
+
 == 0.3.0 / 2008-12-14
 
 * Remove the PluginAWeek namespace</diff>
      <filename>CHANGELOG.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-Copyright (c) 2005 Trevor Squires, 2006-2008 Aaron Pfeifer
+Copyright (c) 2006-2009 Aaron Pfeifer
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the</diff>
      <filename>LICENSE</filename>
    </modified>
    <modified>
      <diff>@@ -1,25 +1,25 @@
-= acts_as_enumeration
+= enumerate_by
 
-+acts_as_enumeration+ adds support for declaring an ActiveRecord class as an
++enumerate_by+ adds support for declaring an ActiveRecord class as an
 enumeration.
 
 == Resources
 
 API
 
-* http://api.pluginaweek.org/acts_as_enumeration
+* http://api.pluginaweek.org/enumerate_by
 
 Bugs
 
-* http://pluginaweek.lighthouseapp.com/projects/13265-acts_as_enumeration
+* http://pluginaweek.lighthouseapp.com/projects/13265-enumerate_by
 
 Development
 
-* http://github.com/pluginaweek/acts_as_enumeration
+* http://github.com/pluginaweek/enumerate_by
 
 Source
 
-* git://github.com/pluginaweek/acts_as_enumeration.git
+* git://github.com/pluginaweek/enumerate_by.git
 
 == Description
 
@@ -28,131 +28,80 @@ example, MySQL has native support for the enum data type.  However, there is
 no native Rails support for defining enumerations and the associations between
 it and other models in the application.
 
-acts_as_enumeration adds support for enumerations in Rails by providing methods
-for interacting with records in a table as if they were values in an
-enumeration.  The important thing to remember about this plugin is that you
-always use the enumeration attributes within the application and know that the
-enumeration ids are stored in the database.  This means that you would use 'red'
-everywhere in your code when referencing the 'red' enumeration identifier, but
-it would always be stored in the database with the integer value of 1.
+In addition, enumerations may often have more complex data and/or functionality
+associated with it that cannot simply be describe in a single column.
 
-In addition, remember that your enumerations act almost exactly like regular
-ActiveRecord models.  This means that you can define validations, enumerations,
-etc.  There is limited support for advanced finder options, addressed by the
-in_memory branch discussed later on.
+enumerate_by adds support for pseudo-enumerations in Rails by allowing the
+enumeration's records to be defined in code, but continuing to express the
+relationship between an enumeration and other models using ActiveRecord
+associations.  The important thing to remember, however, is that while the
+associations exist, the enumerator is always used outside of the application,
+while either the enumerator or the enumerator's record would be referenced
+*within* the application.  This means that you would reference a Color record
+via it's enumerator (such as &quot;red&quot;) everywhere in the code (conditions,
+assigning associations, forms, etc.), but it would always be stored in the
+database as a true association with the integer value of 1.
 
 == Usage
 
-=== Default enumeration
-
   class Color &lt; ActiveRecord::Base
-    acts_as_enumeration
-    
-    create :id =&gt; 1, :name =&gt; 'red'
-    create :id =&gt; 2, :name =&gt; 'blue'
-    create :id =&gt; 3, :name =&gt; 'green'
-  end
-
-=== Customized enumeration
-
-  class Book &lt; ActiveRecord::Base
-    acts_as_enumeration :title
+    enumerate_by :name
     
-    create :id =&gt; 1, :title =&gt; 'Blink'
-  end
-
-=== Additional enumeration attributes
-
-  class Book &lt; ActiveRecord::Base
-    acts_as_enumeration :title
-    
-    column :author, :string
-    column :num_pages, :integer
-    
-    validates_presence_of :author
-    validates_presence_of :num_pages
+    belongs_to :group, :class_name =&gt; 'ColorGroup'
+    has_many :cars
     
-    create :id =&gt; 1, :title =&gt; 'Blink', :author =&gt; 'Malcolm Gladwell', :num_pages =&gt; 277
+    bootstrap(
+      {:id =&gt; 1, :name =&gt; 'red', :group =&gt; 'RGB'},
+      {:id =&gt; 2, :name =&gt; 'blue', :group =&gt; 'RGB'},
+      {:id =&gt; 3, :name =&gt; 'green', :group =&gt; 'RGB'},
+      {:id =&gt; 4, :name =&gt; 'cyan', :group =&gt; 'CMYK'}
+    )
   end
-
-=== Associations
-
+  
   class ColorGroup &lt; ActiveRecord::Base
-    acts_as_enumeration
+    enumerate_by :name
     
     has_many :colors, :foreign_key =&gt; 'group_id'
     
-    create :id =&gt; 1, :name =&gt; 'RGB'
-    create :id =&gt; 2, :name =&gt; 'CMYK'
+    bootstrap(
+      {:id =&gt; 1, :name =&gt; 'RGB'},
+      {:id =&gt; 2, :name =&gt; 'CMYK'}
+    )
   end
   
-  class Color &lt; ActiveRecord::Base
-    acts_as_enumeration
-    
-    column :group_id, :integer
-    
-    belongs_to :group, :class_name =&gt; 'ColorGroup'
-    has_many :cars
-  end
-
   class Car &lt; ActiveRecord::Base
     belongs_to :color
   end
 
-=== Setting enumeration attributes
+Each of the above models is backed by the database with its own table.  Both
+the Color and ColorGroup enumerations automatically synchronize with the
+records in the database based on what's define in their bootstrap data.
 
-  class Color &lt; ActiveRecord::Base
-    acts_as_enumeration
-    
-    create :id =&gt; 1, :name =&gt; 'red'
-    create :id =&gt; 2, :name =&gt; 'blue'
-    create :id =&gt; 3, :name =&gt; 'green'
-  end
-  
-  class Car &lt; ActiveRecord::Base
-    belongs_to :car
-  end
+The enumerations and their associations can be then be used like so:
+
+  car = Car.create(:color =&gt; 'red')   # =&gt; #&lt;Car id: 1, color_id: 1&gt;
+  car.color                           # =&gt; #&lt;Color id: 1, name: &quot;red&quot;&gt;
+  car.color == 'red'                  # =&gt; true
+  car.color.name                      # =&gt; &quot;red&quot;
   
-  car = Car.create(:color =&gt; 'red')
   car.color = 'blue'
+  car.save                            # =&gt; true
+  car                                 # =&gt; #&lt;Car id: 1, color_id: 2&gt;
+  
+  # Serialization
+  car.to_json                         # =&gt; &quot;{id: 1, color: \&quot;blue\&quot;}&quot;
+  car.to_xml                          # =&gt; &quot;&lt;car&gt;&lt;id type=\&quot;integer\&quot;&gt;1&lt;/id&gt;&lt;color&gt;blue&lt;/color&gt;&lt;/car&gt;&quot;
+  
+  # Lookup
+  Car.with_color('blue')              # =&gt; [#&lt;Car id: 1, color_id: 2&gt;]
+  car = Car.find_by_color('blue')     # =&gt; #&lt;Car id: 1, color_id: 2&gt;
+  car.color == Color['blue']          # =&gt; true
 
-=== Camelcase/underscore lookups
-
-If you want to look up enumeration records by the underscore equivalent of its
-camelcased name, the following technique should be used:
-
-  class CreditCardType &lt; ActiveRecord::Base
-    acts_as_enumeration
-    
-    column :display_name
-    
-    def initialize(attributes = nil) #:nodoc:
-      super
-      self.name = default_name unless attributes &amp;&amp; attributes.include?(:name)
-    end
-    
-    private
-      def default_name
-        display_name.gsub(/[^A-Za-z0-9-]/, '').underscore
-      end
-    
-    create :id =&gt; 1, :display_name =&gt; 'Visa'
-    create :id =&gt; 2, :display_name =&gt; 'Mastercard'
-    create :id =&gt; 3, :display_name =&gt; 'American Express', :name =&gt; 'amex'
-    create :id =&gt; 4, :display_name =&gt; 'Discover'
-  end
-
-Rather than relying on the plugin to do the conversion, this technique gives you
-more control over the exact values that can be used for looking up enumerations.
-Note that this could be simplified even further using the
-active_record_defaults[http://svn.viney.net.nz/things/rails/plugins/active_record_defaults] plugin.
-
-== Future development
-
-See the in_memory[http://github.com/pluginaweek/acts_as_enumeration/tree/in_memory] branch
-for for an experimental re-implementation of this plugin.  That branch uses an
-in-memory SQLite3 database for managing enumerations and helps ease maintenance
-of the implementation, while allow the full utilization of ActiveRecord.
+As mentioned previously, the important thing to note from the above example is
+that from an external perspective, &quot;color&quot; is simply an attribute on the Car.
+However, it's backed by a more complex association and model that allows Color
+to include advanced functionality that would normally not be possible with a
+simple attribute.
 
 == Testing
 
@@ -166,7 +115,3 @@ To run against a specific version of Rails:
 == Dependencies
 
 * Rails 2.1 or later
-
-== References
-
-* Trevor Squires - enumerations_mixin[http://svn.protocool.com/public/plugins/enumerations_mixin]</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'rake/gempackagetask'
 require 'rake/contrib/sshpublisher'
 
 spec = Gem::Specification.new do |s|
-  s.name              = 'acts_as_enumeration'
+  s.name              = 'enumerate_by'
   s.version           = '0.3.0'
   s.platform          = Gem::Platform::RUBY
   s.summary           = 'Adds support for declaring an ActiveRecord class as an enumeration'</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-require 'acts_as_enumeration'
\ No newline at end of file
+require 'enumerate_by'</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,4 @@
 class Car &lt; ActiveRecord::Base
-  belongs_to  :color
-  belongs_to  :manufacturer
-  has_many    :passengers
+  belongs_to :color
+  belongs_to :feature, :polymorphic =&gt; true
 end</diff>
      <filename>test/app_root/app/models/car.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 class Color &lt; ActiveRecord::Base
-  acts_as_enumeration
+  enumerate_by :name
 end</diff>
      <filename>test/app_root/app/models/color.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,58 +33,16 @@ module Factory
     record
   end
   
-  build Ambassador do |attributes|
-    attributes.reverse_merge!(
-      :country =&gt; 'United States',
-      :name =&gt; 'John Smith'
-    )
-  end
-  
-  build Book do |attributes|
-    attributes.reverse_merge!(
-      :id =&gt; 1,
-      :title =&gt; 'Blink'
-    )
-  end
-  
   build Car do |attributes|
+    attributes[:color] = create_color unless attributes.include?(:color)
     attributes.reverse_merge!(
-      :name =&gt; 'Ford Mustang',
-      :color_id =&gt; 1
+      :name =&gt; 'Ford Mustang'
     )
   end
   
   build Color do |attributes|
     attributes.reverse_merge!(
-      :id =&gt; 1,
       :name =&gt; 'red'
     )
   end
-  
-  build Country do |attributes|
-    attributes.reverse_merge!(
-      :id =&gt; 1,
-      :name =&gt; 'United States'
-    )
-  end
-  
-  build Language do |attributes|
-    attributes[:country] = create_country unless attributes.include?(:country)
-    attributes.reverse_merge!(
-      :id =&gt; 1,
-      :name =&gt; 'English'
-    )
-  end
-  
-  build Passenger do |attributes|
-    attributes[:car] = create_car unless attributes.include?(:car)
-  end
-  
-  build Region do |attributes|
-    attributes[:country] = create_country unless attributes.include?(:country)
-    attributes.reverse_merge!(
-      :id =&gt; 1,
-      :name =&gt; 'New Jersey'
-    )
-  end
 end</diff>
      <filename>test/factory.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,3 +11,16 @@ require File.expand_path(&quot;#{File.dirname(__FILE__)}/factory&quot;)
 Test::Unit::TestCase.class_eval do
   include Factory
 end
+
+# Add query counter
+ActiveRecord::Base.connection.class.class_eval do
+  IGNORED_SQL = [/^PRAGMA/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/, /SHOW FIELDS/]
+  
+  def execute_with_query_record(sql, name = nil, &amp;block)
+    $queries_executed ||= []
+    $queries_executed &lt;&lt; sql unless IGNORED_SQL.any? { |r| sql =~ r }
+    execute_without_query_record(sql, name, &amp;block)
+  end
+  
+  alias_method_chain :execute, :query_record
+end</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,236 +1,70 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class ModelWithBelongsToAssociationTest &lt; Test::Unit::TestCase
+class ModelWithBelongsToAssociationTest &lt; ActiveRecord::TestCase
   def setup
-    @red = create_color(:id =&gt; 1, :name =&gt; 'red')
-    @blue = create_color(:id =&gt; 2, :name =&gt; 'blue')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color_id =&gt; 1)
+    @red = create_color(:name =&gt; 'red')
+    @green = create_color(:name =&gt; 'green')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; nil)
   end
   
   def test_should_find_association_from_id
+    @car.color_id = @red.id
     assert_equal @red, @car.color
   end
   
-  def test_should_use_the_cached_association
-    assert_same @red, @car.color
-  end
-  
-  def test_should_infer_enumeration_from_a_symbolized_name
-    @car.color = :blue
-    assert_equal @blue, @car.color
-  end
-  
-  def test_should_infer_enumeration_from_a_stringified_name
-    @car.color = 'blue'
-    assert_equal @blue, @car.color
-  end
-  
-  def test_should_infer_enumeration_from_an_id
-    @car.color = 2
-    assert_equal @blue, @car.color
+  def test_should_find_association_from_enumerator
+    @car.color = 'green'
+    assert_equal @green, @car.color
   end
   
-  def test_should_infer_enumeration_from_a_record
-    @car.color = @blue
-    assert_equal @blue, @car.color
+  def test_should_find_assocation_from_record
+    @car.color = @green
+    assert_equal @green, @car.color
   end
   
   def test_should_use_nil_if_enumeration_does_not_exist
-    @car.color = 'green'
+    @car.color = 'blue'
     assert_nil @car.color
   end
   
   def test_should_track_associations
-    expected = {'color_id' =&gt; 'color', 'manufacturer_id' =&gt; 'manufacturer'}
+    expected = {'color_id' =&gt; 'color'}
     assert_equal expected, Car.enumeration_associations
   end
-  
-  def teardown
-    Color.destroy_all
-  end
-end
-
-class EnumerationWithBelongsToAssociationTest &lt; Test::Unit::TestCase
-  def setup
-    @united_states = create_country(:id =&gt; 1, :name =&gt; 'United States')
-    @canada = create_country(:id =&gt; 2, :name =&gt; 'Canada')
-    @california = create_region(:name =&gt; 'California', :country =&gt; nil)
-    @california.country_id = @united_states.id
-  end
-  
-  def test_should_find_association_from_id
-    assert_equal @united_states, @california.country
-  end
-  
-  def test_should_use_the_cached_association
-    assert_same @united_states, @california.country
-  end
-  
-  def test_should_infer_enumeration_from_a_symbolized_name
-    @california.country = :Canada
-    assert_equal @canada, @california.country
-  end
-  
-  def test_should_infer_enumeration_from_a_stringified_name
-    @california.country = 'Canada'
-    assert_equal @canada, @california.country
-  end
-  
-  def test_should_infer_enumeration_from_an_id
-    @california.country = 2
-    assert_equal @canada, @california.country
-  end
-  
-  def test_should_infer_enumeration_from_a_record
-    @california.country = @canada
-    assert_equal @canada, @california.country
-  end
-  
-  def test_should_use_nil_if_enumeration_does_not_exist
-    @california.country = 'Nonexistent'
-    assert_nil @california.country
-  end
-  
-  def teardown
-    Region.destroy_all
-    Country.destroy_all
-  end
-end
-
-class ModelWithBelongsToAssociationAsAClassTest &lt; Test::Unit::TestCase
-  def setup
-    @red = create_color(:id =&gt; 1, :name =&gt; 'red')
-    @blue = create_color(:id =&gt; 2, :name =&gt; 'blue')
-    @red_car = create_car(:name =&gt; 'Ford Mustang', :color_id =&gt; 1)
-    @blue_car = create_car(:name =&gt; 'Ford Mustang', :color_id =&gt; 2)
-    
-    @ford = create_car(:name =&gt; 'Ford Mustang', :color_id =&gt; 1, :manufacturer_id =&gt; 1)
-    @chevy = create_car(:name =&gt; 'Chevy Silverado', :color_id =&gt; 1, :manufacturer_id =&gt; 2)
-  end
-  
-  def test_should_have_a_named_scope_for_finding_a_single_enumeration_identifier
-    assert_equal [@ford], Car.with_manufacturer('ford')
-    assert_equal [@chevy], Car.with_manufacturer('chevy')
-  end
-  
-  def test_should_have_a_named_scope_for_finding_multiple_enumeration_identifiers
-    assert_equal [@ford, @chevy], Car.with_manufacturers('ford', 'chevy')
-  end
-  
-  def teardown
-    Color.destroy_all
-  end
-end
-
-class EnumerationWithBelongsToAssociationAsAClassTest &lt; Test::Unit::TestCase
-  def setup
-    @united_states = create_country(:id =&gt; 1, :name =&gt; 'United States')
-    @canada = create_country(:id =&gt; 2, :name =&gt; 'Canada')
-    
-    @california = create_region(:id =&gt; 1, :name =&gt; 'California', :country =&gt; @united_states)
-    @quebec = create_region(:id =&gt; 2, :name =&gt; 'Quebec', :country =&gt; @canada)
-  end
-  
-  def test_should_have_a_named_scope_for_finding_a_single_enumeration_identifier
-    assert_equal [@california], Region.with_country('United States')
-    assert_equal [@quebec], Region.with_country('Canada')
-  end
-  
-  def test_should_have_a_named_scope_for_finding_multiple_enumeration_identifiers
-    assert_equal [@california, @quebec], Region.with_countries('United States', 'Canada')
-  end
-  
-  def teardown
-    Region.destroy_all
-    Country.destroy_all
-  end
-end
-
-class ModelWithPolymorphicBelongsToAssociationTest &lt; Test::Unit::TestCase
-  def test_should_not_create_a_named_scope
-    assert !Car.respond_to?(:with_addressable)
-  end
-end
-
-class EnumerationWithHasOneAssociationTest &lt; Test::Unit::TestCase
-  def setup
-    @united_states = create_country(:name =&gt; 'United States')
-    @english = create_language(:id =&gt; 1, :name =&gt; 'English', :country =&gt; 'United States')
-  end
-  
-  def test_should_use_the_cached_association
-    assert_same @english, @united_states.language
-  end
-  
-  def teardown
-    Language.destroy_all
-    Country.destroy_all
-  end
 end
 
-class EnumerationWithHasOneModelTest &lt; Test::Unit::TestCase
+class ModelWithEnumerationScopesTest &lt; ActiveRecord::TestCase
   def setup
-    @united_states = create_country(:name =&gt; 'United States')
-    @john_smith = create_ambassador(:name =&gt; 'John Doe', :country =&gt; 'United States')
+    @red = create_color(:name =&gt; 'red')
+    @blue = create_color(:name =&gt; 'blue')
+    @red_car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
+    @blue_car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @blue)
   end
   
-  def test_should_have_an_association
-    assert_equal @john_smith, @united_states.ambassador
-  end
-  
-  def test_should_automatically_reload_association
-    @john_smith.destroy
-    assert_nil @united_states.ambassador
-  end
-  
-  def teardown
-    Country.destroy_all
-  end
-end
-
-class EnumerationWithHasManyAssociationTest &lt; Test::Unit::TestCase
-  def setup
-    @united_states = create_country(:name =&gt; 'United States')
-    @new_jersey = create_region(:id =&gt; 1, :name =&gt; 'New Jersey', :country =&gt; 'United States')
-    @new_york = create_region(:id =&gt; 2, :name =&gt; 'New York', :country =&gt; 'United States')
+  def test_should_have_inclusion_scope_for_single_enumerator
+    assert_equal [@red_car], Car.with_color('red')
+    assert_equal [@blue_car], Car.with_color('blue')
   end
   
-  def test_should_use_the_cached_associations
-    assert_equal [@new_jersey, @new_york], @united_states.regions
+  def test_should_have_inclusion_scope_for_multiple_enumerators
+    assert_equal [@red_car, @blue_car], Car.with_color('red', 'blue')
   end
   
-  def teardown
-    Region.destroy_all
-    Country.destroy_all
-  end
-end
-
-class EnumerationWithHasManyModelAssociationTest &lt; Test::Unit::TestCase
-  def setup
-    @manufacturer = Manufacturer[:ford]
-    @first_car = create_car(:manufacturer =&gt; @manufacturer)
-    
-    # Load the association
-    @manufacturer.cars.inspect
+  def test_should_have_exclusion_scope_for_single_enumerator
+    assert_equal [@blue_car], Car.without_color('red')
+    assert_equal [@red_car], Car.without_color('blue')
   end
   
-  def test_should_automatically_reload_associations
-    second_car = create_car(:manufacturer =&gt; @manufacturer)
-    assert_equal [@first_car, second_car], @manufacturer.cars
+  def test_should_have_exclusion_scope_for_multiple_enumerators
+    assert_equal [], Car.without_colors('red', 'blue')
   end
 end
 
-class ModelWithHasManyModelAssociationTest &lt; Test::Unit::TestCase
-  def setup
-    @car = create_car
-    @first_passenger = create_passenger(:car =&gt; @car)
-    
-    # Load the association
-    @car.passengers.inspect
-  end
-  
-  def test_should_not_automatically_reload_associations
-    create_passenger(:car =&gt; @car)
-    assert_equal [@first_passenger], @car.passengers
+class ModelWithPolymorphicBelongsToAssociationTest &lt; ActiveRecord::TestCase
+  def test_should_not_create_named_scopes
+    assert !Car.respond_to?(:with_feature)
+    assert !Car.respond_to?(:with_features)
+    assert !Car.respond_to?(:without_feature)
+    assert !Car.respond_to?(:without_features)
   end
 end</diff>
      <filename>test/unit/assocations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,11 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class EnumerationWithFinderConditionsTest &lt; Test::Unit::TestCase
+class EnumerationWithFinderConditionsTest &lt; ActiveRecord::TestCase
   def setup
-    @red = create_color(:id =&gt; 1, :name =&gt; 'red')
-    @blue = create_color(:id =&gt; 2, :name =&gt; 'blue')
-    @red_car = create_car(:name =&gt; 'Ford Mustang', :color_id =&gt; 1)
-    @blue_car = create_car(:name =&gt; 'Ford Mustang', :color_id =&gt; 2)
+    @red = create_color(:name =&gt; 'red')
+    @blue = create_color(:name =&gt; 'blue')
+    @red_car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
+    @blue_car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @blue)
   end
   
   def test_should_replace_enumerations_in_dynamic_finders
@@ -17,36 +17,30 @@ class EnumerationWithFinderConditionsTest &lt; Test::Unit::TestCase
   end
   
   def test_should_replace_enumerations_in_find_conditions
-    assert_equal @red_car, Car.find(:first, :conditions =&gt; {:color =&gt; 'red'})
+    assert_equal @red_car, Car.first(:conditions =&gt; {:color =&gt; 'red'})
   end
   
   def test_should_replace_multiple_enumerations_in_find_conditions
-    assert_equal [@red_car, @blue_car], Car.find(:all, :conditions =&gt; {:color =&gt; %w(red blue)})
-  end
-  
-  def teardown
-    Color.destroy_all
+    assert_equal [@red_car, @blue_car], Car.all(:conditions =&gt; {:color =&gt; %w(red blue)})
   end
 end
 
-class EnumerationWithFinderUpdatesTest &lt; Test::Unit::TestCase
+class EnumerationWithFinderUpdatesTest &lt; ActiveRecord::TestCase
   def setup
-    @red = create_color(:id =&gt; 1, :name =&gt; 'red')
-    @blue = create_color(:id =&gt; 2, :name =&gt; 'blue')
-    @red_car = create_car(:name =&gt; 'Ford Mustang', :color_id =&gt; 1)
+    @red = create_color(:name =&gt; 'red')
+    @blue = create_color(:name =&gt; 'blue')
+    @red_car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
   end
   
   def test_should_replace_enumerations_in_update_conditions
     Car.update_all({:color =&gt; 'blue'}, :name =&gt; 'Ford Mustang')
     @red_car.reload
-    assert_equal 'blue', @red_car.color
+    assert_equal @blue, @red_car.color
   end
   
   def test_should_not_replace_multiple_enumerations_in_update_conditions
-    assert_raise(ActiveRecord::RecordNotFound) {Car.update_all({:color =&gt; %w(red blue)}, :name =&gt; 'Ford Mustang')}
-  end
-  
-  def teardown
-    Color.destroy_all
+    Car.update_all({:color =&gt; %w(red blue)}, :name =&gt; 'Ford Mustang')
+    @red_car.reload
+    assert_equal @red, @red_car.color
   end
 end</diff>
      <filename>test/unit/base_conditions_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,18 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class JSONSerializerTest &lt; Test::Unit::TestCase
+class JSONSerializerTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
+    @json = @car.to_json
   end
   
-  def test_should_be_able_to_convert_to_xml
-    json = @car.to_json
-    
-    assert_match %r{&quot;color&quot;: &quot;red&quot;}, json
-    assert_match %r{&quot;id&quot;: #{@car.id}}, json
-    assert_match %r{&quot;manufacturer&quot;: null}, json
-    assert_match %r{&quot;name&quot;: &quot;Ford Mustang&quot;}, json
+  def test_should_include_enumeration_in_json
+    assert_match %r{&quot;color&quot;: &quot;red&quot;}, @json
   end
   
-  def teardown
-    Color.destroy_all
+  def test_should_render_other_attributes
+    assert_match %r{&quot;id&quot;: #{@car.id}}, @json
+    assert_match %r{&quot;name&quot;: &quot;Ford Mustang&quot;}, @json
   end
 end</diff>
      <filename>test/unit/json_serializer_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,63 +1,57 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class SerializerByDefaultTest &lt; Test::Unit::TestCase
+class SerializerByDefaultTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
     @serializer = ActiveRecord::Serialization::Serializer.new(@car)
   end
   
   def test_should_include_enumerations_in_serializable_attribute_names
-    assert_equal %w(color id manufacturer name), @serializer.serializable_attribute_names
+    assert_equal %w(color feature_id feature_type id name), @serializer.serializable_attribute_names
   end
   
   def test_should_typecast_serializable_record
     expected = {
       'color' =&gt; 'red',
+      'feature_id' =&gt; nil,
+      'feature_type' =&gt; nil,
       'id' =&gt; @car.id,
-      'manufacturer' =&gt; nil,
       'name' =&gt; 'Ford Mustang'
     }
     
     assert_equal expected, @serializer.serializable_record
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end
 
-class SerializerWithoutEnumerationsTest &lt; Test::Unit::TestCase
+class SerializerWithoutEnumerationsTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
     @serializer = ActiveRecord::Serialization::Serializer.new(@car, :enumerations =&gt; false)
   end
   
   def test_should_not_include_enumerations_in_serializable_attribute_names
-    assert_equal %w(color_id id manufacturer_id name), @serializer.serializable_attribute_names
+    assert_equal %w(color_id feature_id feature_type id name), @serializer.serializable_attribute_names
   end
   
   def test_should_not_typecast_serializable_record
     expected = {
-      'color_id' =&gt; @color.id,
+      'color_id' =&gt; @red.id,
+      'feature_id' =&gt; nil,
+      'feature_type' =&gt; nil,
       'id' =&gt; @car.id,
-      'manufacturer_id' =&gt; nil,
       'name' =&gt; 'Ford Mustang'
     }
     
     assert_equal expected, @serializer.serializable_record
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end
 
-class SerializerWithOnlyEnumerationAttributeTest &lt; Test::Unit::TestCase
+class SerializerWithOnlyEnumerationAttributeTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
     @serializer = ActiveRecord::Serialization::Serializer.new(@car, :only =&gt; [:id, :color_id])
   end
   
@@ -67,22 +61,18 @@ class SerializerWithOnlyEnumerationAttributeTest &lt; Test::Unit::TestCase
   
   def test_should_not_typecast_serializable_record
     expected = {
-      'color_id' =&gt; @color.id,
+      'color_id' =&gt; @red.id,
       'id' =&gt; @car.id
     }
     
     assert_equal expected, @serializer.serializable_record
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end
 
-class SerializerWithOnlyEnumerationAssociationTest &lt; Test::Unit::TestCase
+class SerializerWithOnlyEnumerationAssociationTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
     @serializer = ActiveRecord::Serialization::Serializer.new(@car, :only =&gt; [:color, :id])
   end
   
@@ -98,91 +88,79 @@ class SerializerWithOnlyEnumerationAssociationTest &lt; Test::Unit::TestCase
     
     assert_equal expected, @serializer.serializable_record
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end
 
-class SerializerWithExceptEnumerationAttributeTest &lt; Test::Unit::TestCase
+class SerializerWithExceptEnumerationAttributeTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
     @serializer = ActiveRecord::Serialization::Serializer.new(@car, :except =&gt; :color_id)
   end
   
   def test_should_not_include_enumeration_in_serializable_attribute_names
-    assert_equal %w(id manufacturer name), @serializer.serializable_attribute_names
+    assert_equal %w(feature_id feature_type id name), @serializer.serializable_attribute_names
   end
   
   def test_should_not_include_enumeration_in_serializable_record
     expected = {
+      'feature_id' =&gt; nil,
+      'feature_type' =&gt; nil,
       'id' =&gt; @car.id,
-      'manufacturer' =&gt; nil,
       'name' =&gt; 'Ford Mustang'
     }
     
     assert_equal expected, @serializer.serializable_record
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end
 
-class SerializerWithExceptEnumerationAssociationTest &lt; Test::Unit::TestCase
+class SerializerWithExceptEnumerationAssociationTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
     @serializer = ActiveRecord::Serialization::Serializer.new(@car, :except =&gt; :color)
   end
   
   def test_should_not_include_enumeration_in_serializable_attribute_names
-    assert_equal %w(id manufacturer name), @serializer.serializable_attribute_names
+    assert_equal %w(feature_id feature_type id name), @serializer.serializable_attribute_names
   end
   
   def test_should_not_include_enumeration_in_serializable_record
     expected = {
+      'feature_id' =&gt; nil,
+      'feature_type' =&gt; nil,
       'id' =&gt; @car.id,
-      'manufacturer' =&gt; nil,
       'name' =&gt; 'Ford Mustang'
     }
     
     assert_equal expected, @serializer.serializable_record
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end
 
-class SerializerWithIncludeEnumerationTest &lt; Test::Unit::TestCase
+class SerializerWithIncludeEnumerationTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
     @serializer = ActiveRecord::Serialization::Serializer.new(@car, :include =&gt; :color)
   end
   
   def test_should_not_include_enumeration_in_serializable_attribute_names
-    assert_equal %w(color_id id manufacturer name), @serializer.serializable_attribute_names
+    assert_equal %w(color_id feature_id feature_type id name), @serializer.serializable_attribute_names
   end
   
   def test_should_include_entire_enumeration_in_serializable_record
     expected = {
       :color =&gt; {
-        'id' =&gt; @color.id,
+        'html' =&gt; nil,
+        'id' =&gt; @red.id,
         'name' =&gt; 'red'
       },
-      'color_id' =&gt; @color.id,
+      'color_id' =&gt; @red.id,
+      'feature_id' =&gt; nil,
+      'feature_type' =&gt; nil,
       'id' =&gt; @car.id,
-      'manufacturer' =&gt; nil,
       'name' =&gt; 'Ford Mustang'
     }
     
     assert_equal expected, @serializer.serializable_record
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end</diff>
      <filename>test/unit/serializer_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,9 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class XmlSerializerAttributeWithEnumerationTest &lt; Test::Unit::TestCase
+class XmlSerializerAttributeWithEnumerationTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
     @attribute = ActiveRecord::XmlSerializer::Attribute.new('color', @car)
   end
   
@@ -11,39 +11,31 @@ class XmlSerializerAttributeWithEnumerationTest &lt; Test::Unit::TestCase
     assert_equal :string, @attribute.type
   end
   
-  def test_should_use_enumeration_value
+  def test_should_use_enumerator
     assert_equal 'red', @attribute.value
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end
 
-class XmlSerializerAttributeWithNilEnumerationTest &lt; Test::Unit::TestCase
+class XmlSerializerAttributeWithNilEnumerationTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
-    @attribute = ActiveRecord::XmlSerializer::Attribute.new('manufacturer', @car)
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; nil)
+    @attribute = ActiveRecord::XmlSerializer::Attribute.new('color', @car)
   end
   
   def test_should_have_a_string_type
     assert_equal :string, @attribute.type
   end
   
-  def test_should_use_enumeration_value
+  def test_should_use_nil
     assert_nil @attribute.value
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end
 
-class XmlSerializerAttributeWithoutEnumerationTest &lt; Test::Unit::TestCase
+class XmlSerializerAttributeWithoutEnumerationTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
     @attribute = ActiveRecord::XmlSerializer::Attribute.new('id', @car)
   end
   
@@ -54,16 +46,12 @@ class XmlSerializerAttributeWithoutEnumerationTest &lt; Test::Unit::TestCase
   def test_should_use_attribute_value
     assert_equal @car.id, @attribute.value
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end
 
-class XmlSerializerTest &lt; Test::Unit::TestCase
+class XmlSerializerTest &lt; ActiveRecord::TestCase
   def setup
-    @color = create_color(:name =&gt; 'red')
-    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; 'red')
+    @red = create_color(:name =&gt; 'red')
+    @car = create_car(:name =&gt; 'Ford Mustang', :color =&gt; @red)
   end
   
   def test_should_be_able_to_convert_to_xml
@@ -71,16 +59,13 @@ class XmlSerializerTest &lt; Test::Unit::TestCase
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;car&gt;
   &lt;color&gt;red&lt;/color&gt;
+  &lt;feature-id type=&quot;integer&quot; nil=&quot;true&quot;&gt;&lt;/feature-id&gt;
+  &lt;feature-type nil=&quot;true&quot;&gt;&lt;/feature-type&gt;
   &lt;id type=&quot;integer&quot;&gt;#{@car.id}&lt;/id&gt;
-  &lt;manufacturer nil=&quot;true&quot;&gt;&lt;/manufacturer&gt;
   &lt;name&gt;Ford Mustang&lt;/name&gt;
 &lt;/car&gt;
     eos
     
     assert_equal expected, @car.to_xml
   end
-  
-  def teardown
-    Color.destroy_all
-  end
 end</diff>
      <filename>test/unit/xml_serializer_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/acts_as_enumeration.rb</filename>
    </removed>
    <removed>
      <filename>lib/acts_as_enumeration/collection.rb</filename>
    </removed>
    <removed>
      <filename>lib/acts_as_enumeration/extensions/associations.rb</filename>
    </removed>
    <removed>
      <filename>lib/acts_as_enumeration/extensions/base_conditions.rb</filename>
    </removed>
    <removed>
      <filename>lib/acts_as_enumeration/extensions/serializer.rb</filename>
    </removed>
    <removed>
      <filename>lib/acts_as_enumeration/extensions/xml_serializer.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/app/models/address.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/app/models/ambassador.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/app/models/book.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/app/models/country.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/app/models/language.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/app/models/manufacturer.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/app/models/passenger.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/app/models/region.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/db/migrate/001_create_cars.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/db/migrate/002_create_passengers.rb</filename>
    </removed>
    <removed>
      <filename>test/app_root/db/migrate/003_create_ambassadors.rb</filename>
    </removed>
    <removed>
      <filename>test/unit/acts_as_enumeration_test.rb</filename>
    </removed>
    <removed>
      <filename>test/unit/collection_test.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>bdd335a0820c2e79c3f991c269ed0b82e9ca524d</id>
    </parent>
  </parents>
  <author>
    <name>Aaron Pfeifer</name>
    <email>aaron.pfeifer@gmail.com</email>
  </author>
  <url>http://github.com/pluginaweek/enumerate_by/commit/9f65588a48b9b33d3ef530904400a533a5dad515</url>
  <id>9f65588a48b9b33d3ef530904400a533a5dad515</id>
  <committed-date>2009-04-26T20:25:40-07:00</committed-date>
  <authored-date>2009-04-26T20:25:40-07:00</authored-date>
  <message>Re-brand under the enumerate_by name (no longer uses tableless models)
Improve serialization performance
Add #bootstrap for automatically synchronizing the records in an enumeration's table
Automatically trigger in-memory caching of the enumeration's table when bootstrapping</message>
  <tree>ad8240ea9e4f325641bdea7b92d7836e7a2e7f4f</tree>
  <committer>
    <name>Aaron Pfeifer</name>
    <email>aaron.pfeifer@gmail.com</email>
  </committer>
</commit>
