<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/money/rails/rails_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,4 @@
 coverage
 doc
 pkg
+spec/money/rails/test.db
\ No newline at end of file</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -9,17 +9,17 @@ module ActiveRecord #:nodoc:
 
       module ClassMethods
         
-        def default_currency
-          'USD'
-        end
-        
         def money(name, options = {})
-          options = {:cents =&gt; &quot;#{name}_in_cents&quot;.to_sym, :currency =&gt; default_currency}.merge(options)
+          options = {:cents =&gt; &quot;#{name}_in_cents&quot;.to_sym}.merge(options)
           mapping = [[options[:cents].to_s, 'cents']]
           mapping &lt;&lt; [options[:currency].to_s, 'currency'] if options[:currency]
-          
-          composed_of name, :class_name =&gt; 'Money', :allow_nil =&gt; true, :mapping =&gt; mapping,
-            :converter =&gt; lambda {|m| m.to_money }
+          args = [name, {:class_name =&gt; 'Money', :mapping =&gt; mapping, :converter =&gt; lambda{|m| m.to_money}}]
+          begin
+            composed_of(*args)
+          rescue
+            converter_block = args.last.delete(:converter)
+            composed_of(*args, &amp;converter_block)
+          end
         end
       end
     end</diff>
      <filename>lib/money/rails.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>580bb8e29f769860f5f0f8045fc7117bfc7bb4d4</id>
    </parent>
  </parents>
  <author>
    <name>Zach Dennis</name>
    <email>zach.dennis@gmail.com</email>
  </author>
  <url>http://github.com/collectiveidea/money/commit/2acaf2cc8a9463fe982fb55d8d4f8fad85339410</url>
  <id>2acaf2cc8a9463fe982fb55d8d4f8fad85339410</id>
  <committed-date>2008-11-20T07:36:40-08:00</committed-date>
  <authored-date>2008-11-19T18:06:37-08:00</authored-date>
  <message>Updated ActiveRecord::Acts::Money to not break dynamic finders when not supplied a currency.

The failure was due to the mappings that were being passed into #composed_of. For each mapping, a database column is expected to be found by ActiveRecord when it tries to match on dynamic finders. This removes the idea of a default currency on the ActiveRecord side of things. Folks can use Money.default_currency= to change things globally. If they want to provide a custom currency they can always supply the database field and supply the :currency option.</message>
  <tree>c6578251592baebfc55aab59e4a9ca2125763215</tree>
  <committer>
    <name>Brandon Keepers</name>
    <email>brandon@collectiveidea.com</email>
  </committer>
</commit>
