<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -19,6 +19,9 @@ Assume, for the purposes of this example that the name, age and phone number fie
   bill.should_be_partially_valid_on :phone_number
   bill.partially_valid?  #=&gt; false  (fails now because phone number is checked)
 
+  bill.should_be_partially_valid_except :phone_number
+  bill.partially_valid?  #=&gt; true  (passes now because phone number is not checked)
+
 h2. Notes
 
 After invoking :partially_valid?, the errors object will contain
@@ -28,3 +31,8 @@ partial validation.
 The list of partially valid attributes are stored on the object itself.  The object may be marshalled into session data and restored and will remember the attributes that have been declared to be checked for validity.  However, the list of valid attributes are not persisted to the database.  Generally, this is not a problem, because a model that is only partially valid cannot be saved to the database anyways.
 
 The :valid? method continues to work as before.
+
+h3. Requirements
+
+The flexmock plugin.
+	&gt; gem install flexmock</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -41,6 +41,21 @@ module PartiallyValid
     partially_valid_attributes.uniq!
   end
   
+  # Declare that the list of attributes that should not be added to the list
+  # checked for partial validation. The attribute names may be
+  # strings or symbols. All other attributes will be validated.
+  def should_be_partially_valid_except(*attrs)
+    invalid_attributes = []
+    all_attrs = self.instance_variables.map {|iv| iv.gsub('@','')}
+    # use the key names from @attributes for ActiveRecord objects
+    all_attrs = self.attributes.keys if self.instance_variables.include?('attributes')
+    attrs.each do |attr_name|
+      invalid_attributes &lt;&lt; attr_name.to_s
+    end
+    should_be_valid_on = all_attrs - invalid_attributes
+    should_be_partially_valid_on(should_be_valid_on)
+  end
+
   # Is the model valid on the attributes declared to be checked for
   # partial validation? Errors on non-checked attributes are removed
   # from the error list not not considered as errors for the purpose</diff>
      <filename>lib/partially_valid/core.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,11 +25,17 @@ class FauxErrors
 end
 
 class FauxModel &lt; ActiveRecord::Base
-  attr_reader :errors
+  attr_reader :errors, :x, :y
+  
+  def initialize
+    @x = 1
+    @y = 2
+  end
 
   def valid?
     @errors = FauxErrors.new
     @errors.add(&quot;x&quot;, &quot;bad value&quot;)
+    @errors.add(&quot;y&quot;, &quot;bad value&quot;)
     @errors.empty?
   end
 end
@@ -39,6 +45,7 @@ class TestPartiallyValid &lt; Test::Unit::TestCase
     model = FauxModel.new
     assert ! model.valid?, &quot;Faux Model should have errors&quot;
     assert_equal &quot;bad value&quot;, model.errors.on(:x)
+    assert_equal &quot;bad value&quot;, model.errors.on(:y)
   end
 
   def test_model_with_no_pv_attributes_is_partially_valid
@@ -50,14 +57,44 @@ class TestPartiallyValid &lt; Test::Unit::TestCase
   def test_model_with_pv_attributes_is_not_partially_valid
     model = FauxModel.new
     model.should_be_partially_valid_on(:x)
+    model.should_be_partially_valid_on(:y)
     assert ! model.partially_valid?, &quot;should not be partially valid&quot;
     assert ! model.errors.empty?
     assert_equal &quot;bad value&quot;, model.errors.on(:x)
+    assert_equal &quot;bad value&quot;, model.errors.on(:y)
+  end
+
+  def test_model_with_multiple_pv_attributes_is_not_partially_valid
+    model = FauxModel.new
+    model.should_be_partially_valid_on(:x,:y)
+    assert ! model.partially_valid?, &quot;should not be partially valid&quot;
+    assert ! model.errors.empty?
+    assert_equal &quot;bad value&quot;, model.errors.on(:x)
+    assert_equal &quot;bad value&quot;, model.errors.on(:y)
+  end
+
+  def test_model_with_some_pv_attributes_is_not_partially_valid
+    model = FauxModel.new
+    model.should_be_partially_valid_on(:y)
+    assert ! model.partially_valid?, &quot;should not be partially valid&quot;
+    assert ! model.errors.empty?
+    assert_equal nil, model.errors.on(:x)
+    assert_equal &quot;bad value&quot;, model.errors.on(:y)
   end
 
+  def test_model_with_some_pv_attributes_is_not_partially_valid_using_except
+    model = FauxModel.new
+    model.should_be_partially_valid_except(:y)
+    assert ! model.partially_valid?, &quot;should not be partially valid&quot;
+    assert ! model.errors.empty?
+    assert_equal &quot;bad value&quot;, model.errors.on(:x)
+    assert_equal nil, model.errors.on(:y)
+  end
+  
   def test_model_can_clear_pv_attributes
     model = FauxModel.new
     model.should_be_partially_valid_on(:x)
+    model.should_be_partially_valid_on(:y)
     model.partially_valid_clear
     assert model.partially_valid?, &quot;should be partially valid&quot;
   end</diff>
      <filename>test/partially_valid_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d1164b516e44fac6b793dcfaf1de050b048f79ae</id>
    </parent>
  </parents>
  <author>
    <name>DrMark</name>
    <email>drmark@gmail.com</email>
  </author>
  <url>http://github.com/jimweirich/partially_valid/commit/3485f4f1616dd5fc9a3a5c59d7bd3a9564c3c73e</url>
  <id>3485f4f1616dd5fc9a3a5c59d7bd3a9564c3c73e</id>
  <committed-date>2008-07-03T10:04:51-07:00</committed-date>
  <authored-date>2008-07-03T10:04:51-07:00</authored-date>
  <message>added a should_be_valid_except method, with tests. Also added extra tests for multiple attributes and expanded README.</message>
  <tree>a7e347f2d91fa17532875d34688a3edc5ec3cf2e</tree>
  <committer>
    <name>DrMark</name>
    <email>drmark@gmail.com</email>
  </committer>
</commit>
