<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -63,6 +63,11 @@ module StaticModel
         records[0]
       end
       alias_method :first, :find_first
+      
+      def find_last
+        records[records.length-1]
+      end
+      alias_method :last, :find_last
 
       def find_all_by(attribute, value)
         records.find_all {|r| r.send(attribute) == value }
@@ -72,6 +77,11 @@ module StaticModel
         records.find {|r| r.send(attribute) == value }
       end
       alias_method :find_by, :find_first_by
+      
+      def find_last_by(attribute, value)
+        records.find {|r| r.send(attribute) == value }
+      end
+      alias_method :find_by, :find_last_by
 
       def load(reload = false)
         return if loaded? &amp;&amp; !reload
@@ -153,8 +163,8 @@ module StaticModel
       private
       def method_missing(meth, *args)
         meth_name = meth.to_s
-        if meth_name =~ /^find_(all_by|first_by|by)_(.+)/
-          attribute_name = meth_name.gsub(/^find_(all_by|first_by|by)_/, '')
+        if meth_name =~ /^find_(all_by|first_by|last_by|by)_(.+)/
+          attribute_name = meth_name.gsub(/^find_(all_by|first_by|last_by|by)_/, '')
           finder    = meth_name.gsub(/_#{attribute_name}/, '')
           return self.send(finder, attribute_name, *args)
         elsif class_attributes.has_key? meth_name</diff>
      <filename>lib/static_model/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,427 +1,472 @@
-require File.dirname(__FILE__) + '/test_helper.rb'
-
-class TestStaticModel &lt; Test::Unit::TestCase
-
-  context &quot;StaticModel&quot; do
-    context &quot;A class that inherits from Base&quot; do      
-      context &quot;an instance&quot; do
-
-        setup do
-          @book = Book.new(book_params)
-        end
-
-        context &quot;initialization&quot; do
-
-          should &quot;set attributes with a hash&quot; do
-            assert @book.id
-          end
-
-          should &quot;raise error if passed anything but hash&quot; do
-            assert_raise(StaticModel::BadOptions) do
-              Book.new(&quot;im bad&quot;)
-            end
-          end      
-        end
-
-        context &quot;attributes&quot; do
-          should &quot;get attributes by methods&quot; do
-            assert_equal book_params[:title], @book.title
-            assert_equal book_params[:genre], @book.genre
-          end
-
-          should &quot;set attributes by methods&quot; do
-            @book.title = 'New Title'
-            assert_equal 'New Title', @book.title
-          end
-        end
-
-        context &quot;to_s&quot; do
-          should &quot;inspect&quot; do
-            assert_equal @book.inspect, @book.to_s
-          end
-        end
-
-        context &quot;comparing&quot; do
-
-          should &quot;be equal to an instance of the same class with same id&quot; do
-            assert_equal @book, Book.new(book_params)
-          end
-
-          should &quot;not be equal to an instance with the same class with different ids&quot; do
-            assert_not_equal Book[1], @book
-          end
-
-          should &quot;not be equal to an instance with different classes and the same ids&quot; do
-            assert_not_equal Book[1], Author[1]
-          end
-        end
-
-      end
-
-      context &quot;on the class&quot; do
-        context &quot;set data file&quot; do
-          context &quot;After the class is defined&quot; do
-
-            setup do
-              @book = Book.find(1)
-              @author = Author.find(1)
-              @original_data_file = Book.data_file
-              @data_file = File.join(File.dirname(__FILE__), 'data', 'authors.yml')
-              Book.set_data_file @data_file
-              @new_book = Book.find(1)
-            end
-
-            should &quot;set the @data_file&quot; do
-              assert_equal @data_file, Book.data_file
-            end
-
-            should &quot;reload with next find&quot; do
-              assert @author.attributes, @new_book.attributes
-            end
-
-            teardown do
-              Book.set_data_file @original_data_file
-            end
-          end
-        end
-
-        context &quot;next_id&quot; do
-          context &quot;if id's were automaticaly assigned&quot; do
-            should &quot;be length + 1&quot; do
-              Store.load
-              assert_equal Store.count + 1, Store.next_id
-            end            
-          end
-          
-          context &quot;if ids were manualy assigned&quot; do
-            should &quot;be 1 after the last id&quot; do
-              Publisher.load
-              assert_equal 8, Publisher.next_id
-            end
-          end
-        end
-        
-        context &quot;where the records are defined without ids&quot; do
-          setup do
-            Store.reload!
-          end
-          
-          context &quot;loading&quot; do
-            setup do
-              @stores = Store.all
-            end
-            
-            should &quot;automaticaly assign ids&quot; do
-              @stores.each do |store|
-                assert store.id
-                assert store.id.is_a?(Fixnum)
-              end
-            end
-            
-            should &quot;assign next id&quot; do
-              assert Store.next_id
-              assert_equal 3, Store.next_id
-            end
-          end
-          
-          context &quot;initializing without id&quot; do
-            setup do
-              @store = Store.new({:name =&gt; 'Metro Comics', :city =&gt; 'New York'})
-            end
-                                    
-            should &quot;return instance&quot; do
-              assert @store.is_a?(Store)
-            end
-            
-            should &quot;set attributes&quot; do
-              assert_equal 'New York', @store.city
-            end
-            
-            should &quot;assign id from next id&quot; do
-              assert_equal 3, @store.id
-            end
-            
-            should &quot;increment next_id&quot; do
-              assert_equal 4, Store.next_id
-            end
-            
-          end
-        end
-        
-        context &quot;loading a data_file with embedded erb&quot; do
-          setup do
-            @projects = Project.all
-          end
-          
-          should &quot;evaluate erb expressions at load time&quot; do
-            assert_equal 1.day.ago.strftime('%m/%d/%Y %I:%M%p'), @projects.first.created_at
-          end
-          
-          should &quot;evaluate erb in current context&quot; do
-            assert_equal Author.first, @projects[1].author
-          end
-        end
-
-        context &quot;find&quot; do
-
-          context &quot;with an integer&quot; do
-            setup do
-              @book = Book.find(1)
-            end
-
-            should &quot;set loaded?&quot; do
-              assert Book.loaded?
-            end
-
-            should &quot;load by id&quot; do
-              assert_equal 1, @book.id
-            end
-
-            should &quot;return instance of klass&quot; do
-              assert @book.is_a?(Book)
-            end
-
-            should &quot;raise error if cant find record with id&quot; do
-              assert_raise(StaticModel::RecordNotFound) do
-                @book = Book.find(1000)
-              end
-            end
-          end
-        end
-
-        context &quot;[]&quot; do
-          should &quot;be an alias for find by id&quot; do
-            assert_equal Book.find(1), Book[1]
-          end
-        end
-
-        context &quot;find(:all)&quot; do
-          should &quot;be an alias for find_all&quot; do
-            assert_equal Book.find_all, Book.find(:all)
-          end
-        end
-        context &quot;find(:first)&quot; do
-          should &quot;be an alias for find_first&quot; do
-            assert_equal Book.find_first, Book.find(:first)
-          end
-        end
-
-        context &quot;all&quot; do
-          should &quot;be an alias for find_all&quot; do
-            assert_equal Book.all, Book.find(:all)
-          end
-        end
-        context &quot;first&quot; do
-          should &quot;be an alias for find_first&quot; do
-            assert_equal Book.first, Book.find(:first)
-          end
-        end
-
-        context &quot;find_first&quot; do
-          setup do
-            @book = Book.find_first
-          end
-
-          should &quot;return the first instance from all records&quot; do
-            assert_equal Book.find_all.first, @book
-          end
-
-          should &quot;return instance of klass&quot; do
-            assert @book.is_a?(Book)
-          end
-        end
-
-        context &quot;find_all&quot; do
-          setup do
-            @books = Book.find_all
-          end
-
-          should &quot;return an array&quot; do
-            assert @books.is_a?(Array)
-          end
-
-          should &quot;return all records&quot; do
-            assert_equal 4, @books.length
-          end
-
-          should &quot;return set of klass instances&quot; do
-            @books.each do |book|
-              assert book.is_a?(Book)
-            end
-          end
-
-          context &quot;with an empty data file&quot; do
-            setup do
-              @original_data_file = Book.data_file
-              @data_file = File.join(File.dirname(__FILE__), 'data', 'empty.yml')
-              Book.set_data_file @data_file
-            end
-
-            should &quot;return an empty array&quot; do
-              assert_equal [], Book.find_all
-            end
-
-            teardown do
-              Book.set_data_file @original_data_file
-            end
-
-          end
-        end
-
-        context &quot;find_first_by&quot; do
-          setup do
-            @author = 'Michael Pollan'
-            @book = Book.find_first_by(:author,@author)
-          end
-
-          should &quot;return an instance of klass&quot; do
-            assert @book.is_a?(Book)
-          end
-
-          should &quot;return record matching search&quot; do
-            assert @author, @book.author
-          end
-
-          context &quot;when there is no match&quot; do
-            should &quot;return nil&quot; do
-              assert_nil Book.find_first_by(:author,'Aaron Quint')
-            end
-          end
-        end
-
-        context &quot;find_by&quot; do
-          setup do
-            @author = 'Michael Pollan'
-            @book = Book.find_by(:author,@author)
-          end
-
-          should &quot;return an instance of klass&quot; do
-            assert @book.is_a?(Book)
-          end
-
-          should &quot;return record matching search&quot; do
-            assert @author, @book.author
-          end
-
-          context &quot;when there is no match&quot; do
-            should &quot;return nil&quot; do
-              assert_nil Book.find_by(:author,'Aaron Quint')
-            end
-          end
-
-        end
-
-        context &quot;find_all_by&quot; do
-          setup do
-            @author = 'Michael Pollan'
-            @books = Book.find_all_by(:author,@author)
-          end
-
-          should &quot;return an array&quot; do
-            assert @books.is_a?(Array)
-          end
-
-          should &quot;return all records that match search&quot; do
-            @books.each {|b| assert_equal @author, b.author}
-          end
-
-          should &quot;return set of klass instances&quot; do
-            @books.each {|b| assert b.is_a?(Book) }
-          end
-
-          context &quot;when there is no match&quot; do
-            should &quot;return an empty array&quot; do
-              assert_equal [], Book.find_all_by(:author,'Aaron Quint')
-            end
-          end
-          context &quot;when there is only one match&quot; do
-            should &quot;return an array&quot; do
-              assert_equal [Book.find(3)], Book.find_all_by(:author,'Piers Anthony')
-            end
-          end
-        end
-
-        context &quot;dynamic finders&quot; do
-          setup do
-            @book = Book.first
-          end
-
-          context &quot;find_by_*attribute*&quot; do
-            should &quot;be equivalent to find_first_by(attribute,)&quot; do
-              assert_equal @book, Book.find_first_by(:genre, 'Non-Fiction')
-              assert_equal Book.find_first_by(:genre, 'Non-Fiction'), Book.find_by_genre('Non-Fiction')
-            end
-          end
-
-          context &quot;find_first_by_*attribute*&quot; do
-            should &quot;be equivalent to find_first_by(attribute,)&quot; do
-              assert_equal @book, Book.find_first_by(:genre, 'Non-Fiction')
-              assert_equal Book.find_first_by(:genre, 'Non-Fiction'), Book.find_first_by_genre('Non-Fiction')
-            end
-          end
-
-          context &quot;find_all_by_*attribute*&quot; do
-            should &quot;be equivalent to find_all_by(attribute,)&quot; do
-              assert_equal Book.find_all_by(:genre, 'Non-Fiction'), Book.find_all_by_genre('Non-Fiction')
-            end
-          end
-        end
-
-        context &quot;count&quot; do
-          should &quot;return the count of all records&quot; do
-            assert_equal Book.all.length, Book.count
-          end
-        end
-        
-        context &quot;with a class with yaml class vars&quot; do
-          setup do
-            @pages = Page.all
-          end
-          
-          should &quot;load :records into @records&quot; do
-            assert_set_of Page, @pages
-            assert Page.loaded?
-          end
-          
-          should &quot;give access to top level attributes as class methods&quot; do
-            assert_equal 'http://www.quirkey.com', Page.url
-            assert_equal 'The Best Ever', Page.title
-          end
-          
-          should &quot;return a hash for class attribute&quot; do
-            assert Page.settings.is_a?(Hash)
-            assert_equal 'test', Page.settings['username']
-          end
-          
-          should &quot;have class attributes appear as record accessor defaults if none exist&quot; do
-            assert_equal 'http://www.quirkey.com', Page[1].url
-          end
-          
-          should &quot;not overwrite record specific methods&quot; do
-            assert_equal 'http://github.com', Page[2].url
-          end
-          
-          context &quot;class_attributes&quot; do
-            setup do
-              @attributes = Page.class_attributes
-            end
-            
-            should &quot;return a hash of all top level settings&quot; do
-              assert @attributes.is_a?(Hash)
-              assert_equal 3, @attributes.length
-              assert_equal 'http://www.quirkey.com', @attributes['url']
-            end
-          end
-        end
-
-      end
-    end
-  end
-
-  protected
-  def book_params
-    {:id =&gt; 15, :title =&gt; 'Lord of the Rings', :author =&gt; 'J.R. Tolkien', :genre =&gt; 'Fantasy'}
-  end
-
-
-end
+require File.dirname(__FILE__) + '/test_helper.rb'
+
+class TestStaticModel &lt; Test::Unit::TestCase
+
+  context &quot;StaticModel&quot; do
+    context &quot;A class that inherits from Base&quot; do      
+      context &quot;an instance&quot; do
+
+        setup do
+          @book = Book.new(book_params)
+        end
+
+        context &quot;initialization&quot; do
+
+          should &quot;set attributes with a hash&quot; do
+            assert @book.id
+          end
+
+          should &quot;raise error if passed anything but hash&quot; do
+            assert_raise(StaticModel::BadOptions) do
+              Book.new(&quot;im bad&quot;)
+            end
+          end      
+        end
+
+        context &quot;attributes&quot; do
+          should &quot;get attributes by methods&quot; do
+            assert_equal book_params[:title], @book.title
+            assert_equal book_params[:genre], @book.genre
+          end
+
+          should &quot;set attributes by methods&quot; do
+            @book.title = 'New Title'
+            assert_equal 'New Title', @book.title
+          end
+        end
+
+        context &quot;to_s&quot; do
+          should &quot;inspect&quot; do
+            assert_equal @book.inspect, @book.to_s
+          end
+        end
+
+        context &quot;comparing&quot; do
+
+          should &quot;be equal to an instance of the same class with same id&quot; do
+            assert_equal @book, Book.new(book_params)
+          end
+
+          should &quot;not be equal to an instance with the same class with different ids&quot; do
+            assert_not_equal Book[1], @book
+          end
+
+          should &quot;not be equal to an instance with different classes and the same ids&quot; do
+            assert_not_equal Book[1], Author[1]
+          end
+        end
+
+      end
+
+      context &quot;on the class&quot; do
+        context &quot;set data file&quot; do
+          context &quot;After the class is defined&quot; do
+
+            setup do
+              @book = Book.find(1)
+              @author = Author.find(1)
+              @original_data_file = Book.data_file
+              @data_file = File.join(File.dirname(__FILE__), 'data', 'authors.yml')
+              Book.set_data_file @data_file
+              @new_book = Book.find(1)
+            end
+
+            should &quot;set the @data_file&quot; do
+              assert_equal @data_file, Book.data_file
+            end
+
+            should &quot;reload with next find&quot; do
+              assert @author.attributes, @new_book.attributes
+            end
+
+            teardown do
+              Book.set_data_file @original_data_file
+            end
+          end
+        end
+
+        context &quot;next_id&quot; do
+          context &quot;if id's were automaticaly assigned&quot; do
+            should &quot;be length + 1&quot; do
+              Store.load
+              assert_equal Store.count + 1, Store.next_id
+            end            
+          end
+          
+          context &quot;if ids were manualy assigned&quot; do
+            should &quot;be 1 after the last id&quot; do
+              Publisher.load
+              assert_equal 8, Publisher.next_id
+            end
+          end
+        end
+        
+        context &quot;where the records are defined without ids&quot; do
+          setup do
+            Store.reload!
+          end
+          
+          context &quot;loading&quot; do
+            setup do
+              @stores = Store.all
+            end
+            
+            should &quot;automaticaly assign ids&quot; do
+              @stores.each do |store|
+                assert store.id
+                assert store.id.is_a?(Fixnum)
+              end
+            end
+            
+            should &quot;assign next id&quot; do
+              assert Store.next_id
+              assert_equal 3, Store.next_id
+            end
+          end
+          
+          context &quot;initializing without id&quot; do
+            setup do
+              @store = Store.new({:name =&gt; 'Metro Comics', :city =&gt; 'New York'})
+            end
+                                    
+            should &quot;return instance&quot; do
+              assert @store.is_a?(Store)
+            end
+            
+            should &quot;set attributes&quot; do
+              assert_equal 'New York', @store.city
+            end
+            
+            should &quot;assign id from next id&quot; do
+              assert_equal 3, @store.id
+            end
+            
+            should &quot;increment next_id&quot; do
+              assert_equal 4, Store.next_id
+            end
+            
+          end
+        end
+        
+        context &quot;loading a data_file with embedded erb&quot; do
+          setup do
+            @projects = Project.all
+          end
+          
+          should &quot;evaluate erb expressions at load time&quot; do
+            assert_equal 1.day.ago.strftime('%m/%d/%Y %I:%M%p'), @projects.first.created_at
+          end
+          
+          should &quot;evaluate erb in current context&quot; do
+            assert_equal Author.first, @projects[1].author
+          end
+        end
+
+        context &quot;find&quot; do
+
+          context &quot;with an integer&quot; do
+            setup do
+              @book = Book.find(1)
+            end
+
+            should &quot;set loaded?&quot; do
+              assert Book.loaded?
+            end
+
+            should &quot;load by id&quot; do
+              assert_equal 1, @book.id
+            end
+
+            should &quot;return instance of klass&quot; do
+              assert @book.is_a?(Book)
+            end
+
+            should &quot;raise error if cant find record with id&quot; do
+              assert_raise(StaticModel::RecordNotFound) do
+                @book = Book.find(1000)
+              end
+            end
+          end
+        end
+
+        context &quot;[]&quot; do
+          should &quot;be an alias for find by id&quot; do
+            assert_equal Book.find(1), Book[1]
+          end
+        end
+
+        context &quot;find(:all)&quot; do
+          should &quot;be an alias for find_all&quot; do
+            assert_equal Book.find_all, Book.find(:all)
+          end
+        end
+        context &quot;find(:first)&quot; do
+          should &quot;be an alias for find_first&quot; do
+            assert_equal Book.find_first, Book.find(:first)
+          end
+        end
+        context &quot;find(:last)&quot; do
+          should &quot;be an alias for find_last&quot; do
+            assert_equal Book.find_last, Book.find(:last)
+          end
+        end
+
+        context &quot;all&quot; do
+          should &quot;be an alias for find_all&quot; do
+            assert_equal Book.all, Book.find(:all)
+          end
+        end
+        context &quot;first&quot; do
+          should &quot;be an alias for find_first&quot; do
+            assert_equal Book.first, Book.find(:first)
+          end
+        end
+        context &quot;last&quot; do
+          should &quot;be an alias for find_last&quot; do
+            assert_equal Book.last, Book.find(:last)
+          end
+        end
+
+        context &quot;find_first&quot; do
+          setup do
+            @book = Book.find_first
+          end
+
+          should &quot;return the first instance from all records&quot; do
+            assert_equal Book.find_all.first, @book
+          end
+
+          should &quot;return instance of klass&quot; do
+            assert @book.is_a?(Book)
+          end
+        end
+
+        context &quot;find_last&quot; do
+          setup do
+            @book = Book.find_last
+          end
+          
+          should &quot;return the last instance from all records&quot; do
+            assert_equal Book.find_all.last, @book
+          end
+          
+          should &quot;return an instance of klass&quot; do
+            assert @book.is_a?(Book)
+          end
+        end
+
+        context &quot;find_all&quot; do
+          setup do
+            @books = Book.find_all
+          end
+
+          should &quot;return an array&quot; do
+            assert @books.is_a?(Array)
+          end
+
+          should &quot;return all records&quot; do
+            assert_equal 4, @books.length
+          end
+
+          should &quot;return set of klass instances&quot; do
+            @books.each do |book|
+              assert book.is_a?(Book)
+            end
+          end
+
+          context &quot;with an empty data file&quot; do
+            setup do
+              @original_data_file = Book.data_file
+              @data_file = File.join(File.dirname(__FILE__), 'data', 'empty.yml')
+              Book.set_data_file @data_file
+            end
+
+            should &quot;return an empty array&quot; do
+              assert_equal [], Book.find_all
+            end
+
+            teardown do
+              Book.set_data_file @original_data_file
+            end
+
+          end
+        end
+
+        context &quot;find_first_by&quot; do
+          setup do
+            @author = 'Michael Pollan'
+            @book = Book.find_first_by(:author,@author)
+          end
+
+          should &quot;return an instance of klass&quot; do
+            assert @book.is_a?(Book)
+          end
+
+          should &quot;return record matching search&quot; do
+            assert @author, @book.author
+          end
+
+          context &quot;when there is no match&quot; do
+            should &quot;return nil&quot; do
+              assert_nil Book.find_first_by(:author,'Aaron Quint')
+            end
+          end
+        end
+        
+        context &quot;find_last_by&quot; do
+          setup do
+            @author = 'Chuck Palahniuk'
+            @book = Book.find_last_by(:author, @author)
+          end
+          
+          should &quot;return an instance of klass&quot; do
+            assert @book.is_a?(Book)
+          end
+          
+          should &quot;return record matching search&quot; do
+            assert @author, @book.author
+          end
+          
+          context &quot;when there is no match&quot; do
+            should &quot;return nil&quot; do
+              assert_nil Book.find_last_by(:author, 'Michael R. Bernstein')
+            end
+          end
+        end
+
+        context &quot;find_by&quot; do
+          setup do
+            @author = 'Michael Pollan'
+            @book = Book.find_by(:author,@author)
+          end
+
+          should &quot;return an instance of klass&quot; do
+            assert @book.is_a?(Book)
+          end
+
+          should &quot;return record matching search&quot; do
+            assert @author, @book.author
+          end
+
+          context &quot;when there is no match&quot; do
+            should &quot;return nil&quot; do
+              assert_nil Book.find_by(:author,'Aaron Quint')
+            end
+          end
+
+        end
+
+        context &quot;find_all_by&quot; do
+          setup do
+            @author = 'Michael Pollan'
+            @books = Book.find_all_by(:author,@author)
+          end
+
+          should &quot;return an array&quot; do
+            assert @books.is_a?(Array)
+          end
+
+          should &quot;return all records that match search&quot; do
+            @books.each {|b| assert_equal @author, b.author}
+          end
+
+          should &quot;return set of klass instances&quot; do
+            @books.each {|b| assert b.is_a?(Book) }
+          end
+
+          context &quot;when there is no match&quot; do
+            should &quot;return an empty array&quot; do
+              assert_equal [], Book.find_all_by(:author,'Aaron Quint')
+            end
+          end
+          context &quot;when there is only one match&quot; do
+            should &quot;return an array&quot; do
+              assert_equal [Book.find(3)], Book.find_all_by(:author,'Piers Anthony')
+            end
+          end
+        end
+
+        context &quot;dynamic finders&quot; do
+          setup do
+            @book = Book.first
+          end
+
+          context &quot;find_by_*attribute*&quot; do
+            should &quot;be equivalent to find_first_by(attribute,)&quot; do
+              assert_equal @book, Book.find_first_by(:genre, 'Non-Fiction')
+              assert_equal Book.find_first_by(:genre, 'Non-Fiction'), Book.find_by_genre('Non-Fiction')
+            end
+          end
+
+          context &quot;find_first_by_*attribute*&quot; do
+            should &quot;be equivalent to find_first_by(attribute,)&quot; do
+              assert_equal @book, Book.find_first_by(:genre, 'Non-Fiction')
+              assert_equal Book.find_first_by(:genre, 'Non-Fiction'), Book.find_first_by_genre('Non-Fiction')
+            end
+          end
+
+          context &quot;find_all_by_*attribute*&quot; do
+            should &quot;be equivalent to find_all_by(attribute,)&quot; do
+              assert_equal Book.find_all_by(:genre, 'Non-Fiction'), Book.find_all_by_genre('Non-Fiction')
+            end
+          end
+        end
+
+        context &quot;count&quot; do
+          should &quot;return the count of all records&quot; do
+            assert_equal Book.all.length, Book.count
+          end
+        end
+        
+        context &quot;with a class with yaml class vars&quot; do
+          setup do
+            @pages = Page.all
+          end
+          
+          should &quot;load :records into @records&quot; do
+            assert_set_of Page, @pages
+            assert Page.loaded?
+          end
+          
+          should &quot;give access to top level attributes as class methods&quot; do
+            assert_equal 'http://www.quirkey.com', Page.url
+            assert_equal 'The Best Ever', Page.title
+          end
+          
+          should &quot;return a hash for class attribute&quot; do
+            assert Page.settings.is_a?(Hash)
+            assert_equal 'test', Page.settings['username']
+          end
+          
+          should &quot;have class attributes appear as record accessor defaults if none exist&quot; do
+            assert_equal 'http://www.quirkey.com', Page[1].url
+          end
+          
+          should &quot;not overwrite record specific methods&quot; do
+            assert_equal 'http://github.com', Page[2].url
+          end
+          
+          context &quot;class_attributes&quot; do
+            setup do
+              @attributes = Page.class_attributes
+            end
+            
+            should &quot;return a hash of all top level settings&quot; do
+              assert @attributes.is_a?(Hash)
+              assert_equal 3, @attributes.length
+              assert_equal 'http://www.quirkey.com', @attributes['url']
+            end
+          end
+        end
+
+      end
+    end
+  end
+
+  protected
+  def book_params
+    {:id =&gt; 15, :title =&gt; 'Lord of the Rings', :author =&gt; 'J.R. Tolkien', :genre =&gt; 'Fantasy'}
+  end
+
+
+end</diff>
      <filename>test/test_static_model.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2d2d1dfa580a325185d1c6fa3aa3e8600cf7d23c</id>
    </parent>
  </parents>
  <author>
    <name>mrb</name>
    <email>mmbernstein@clinic-it.com</email>
  </author>
  <url>http://github.com/quirkey/static_model/commit/78535d836839ac57269e8f576312cb67797ff6f6</url>
  <id>78535d836839ac57269e8f576312cb67797ff6f6</id>
  <committed-date>2008-12-11T15:08:06-08:00</committed-date>
  <authored-date>2008-12-11T15:08:06-08:00</authored-date>
  <message>Added method for Model.last</message>
  <tree>19977a13be8ce9a31e53ec013ff017906a5d93f9</tree>
  <committer>
    <name>mrb</name>
    <email>mmbernstein@clinic-it.com</email>
  </committer>
</commit>
