<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/unit/phone_number_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -13,9 +13,9 @@
     &lt;p&gt;&lt;b&gt;We need an email address and at least one phone number we can contact you on.&lt;/b&gt;&lt;/p&gt;
     &lt;%= f.text_field_row :email_address %&gt;
     &lt;div class=&quot;clear&quot;&gt;
-    &lt;%= f.text_field_row :mobile_phone %&gt;
-    &lt;%= f.text_field_row :home_phone %&gt;
-    &lt;%= f.text_field_row :work_phone %&gt;
+    &lt;%= f.text_field_row :mobile_phone, nil, :value =&gt; @volunteer.mobile_phone.format %&gt;
+    &lt;%= f.text_field_row :home_phone, nil, :value =&gt; @volunteer.home_phone.format %&gt;
+    &lt;%= f.text_field_row :work_phone, nil, :value =&gt; @volunteer.work_phone.format %&gt;
   &lt;/fieldset&gt;
 
   &lt;fieldset&gt;</diff>
      <filename>app/views/volunteers/new.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -23,6 +23,7 @@ ActiveRecord::Schema.define(:version =&gt; 20090216025059) do
     t.string   &quot;work_phone&quot;
     t.datetime &quot;created_at&quot;
     t.datetime &quot;updated_at&quot;
+    t.string   &quot;email_address&quot;
     t.integer  &quot;can_keep_dogs&quot;
     t.integer  &quot;can_keep_cats&quot;
     t.string   &quot;can_keep_other&quot;
@@ -38,7 +39,6 @@ ActiveRecord::Schema.define(:version =&gt; 20090216025059) do
     t.boolean  &quot;requires_financial_support&quot;
     t.boolean  &quot;can_administer_medical&quot;
     t.integer  &quot;offer_duration&quot;
-    t.string   &quot;email_address&quot;
   end
 
 end</diff>
      <filename>db/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,9 @@ class PhoneNumber &lt; String
   end
   
   def normalize
-    tr(' ()-.', '').gsub(/\A\+/, '').gsub(/\A0/, '61')
+    result = tr(' ()-.', '').gsub(/\A\+/, '')
+    result = &quot;03#{result}&quot; if result =~ /^\d{8}$/
+    result.gsub(/\A0/, '61')
   end
   
   def valid_australian_mobile?</diff>
      <filename>lib/phone_number.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ module ActiveRecord
       def wraps_attribute(attribute, wrapper_class, options = {})
         options = { :validate =&gt; :valid?, :message =&gt; &quot;must be valid&quot; }.merge(options)
         
-        before_validation {|object| object.send(:write_attribute, attribute, object.send(attribute).normalize) }
+        before_save {|object| object.send(:write_attribute, attribute, object.send(attribute).normalize) }
 
         if options[:validate]
           validate do |object|</diff>
      <filename>vendor/plugins/wraps_attribute/lib/wraps_attribute.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3322720dde8aebb7b4ec0e6858897e8bfdf69bbf</id>
    </parent>
  </parents>
  <author>
    <name>Pete Yandell</name>
    <email>pete@notahat.com</email>
  </author>
  <url>http://github.com/mbailey/fun4paws/commit/f893418741ffc706ce213b145fa0769d85baa674</url>
  <id>f893418741ffc706ce213b145fa0769d85baa674</id>
  <committed-date>2009-02-16T19:47:21-08:00</committed-date>
  <authored-date>2009-02-16T19:47:21-08:00</authored-date>
  <message>Made the phone number validation much more friendly. It now accepts phone numbers without an area code (and assumes they are 03), and formats the results more nicely if there's an error.</message>
  <tree>55000c48121e7bddabb822b1f167d7f76f4e3cb1</tree>
  <committer>
    <name>Pete Yandell</name>
    <email>pete@notahat.com</email>
  </committer>
</commit>
