<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -403,8 +403,10 @@ module PluginAWeek #:nodoc:
         # for the attribute
         def add_named_scopes
           [attribute, attribute.pluralize].uniq.each do |name|
-            name = &quot;with_#{name}&quot;
-            owner_class.named_scope name.to_sym, lambda {|*values| {:conditions =&gt; {attribute =&gt; values.flatten}}} unless owner_class.respond_to?(name)
+            with_name = &quot;with_#{name}&quot;
+            without_name = &quot;without_#{name}&quot;
+            owner_class.named_scope with_name.to_sym, lambda {|*values| {:conditions =&gt; {attribute =&gt; values.flatten}}} unless owner_class.respond_to?(with_name)
+            owner_class.named_scope without_name.to_sym, lambda {|*values| {:conditions =&gt; [&quot;#{attribute} NOT IN (?)&quot;, values.flatten]}} unless owner_class.respond_to?(without_name)
           end
         end
     end</diff>
      <filename>lib/state_machine/machine.rb</filename>
    </modified>
    <modified>
      <diff>@@ -60,6 +60,13 @@ class MachineTest &lt; Test::Unit::TestCase
     assert_equal [on], Switch.with_state('on')
   end
   
+  def test_should_define_a_named_scope_for_excluding_the_attribute
+    on = create_switch(:state =&gt; 'on')
+    off = create_switch(:state =&gt; 'off')
+    
+    assert_equal [off], Switch.without_state('on')
+  end
+  
   def test_should_define_a_pluralized_named_scope_for_the_attribute
     on = create_switch(:state =&gt; 'on')
     off = create_switch(:state =&gt; 'off')
@@ -67,6 +74,14 @@ class MachineTest &lt; Test::Unit::TestCase
     assert_equal [on, off], Switch.with_states('on', 'off')
   end
   
+  def test_should_define_a_pluralized_named_scope_for_excluding_the_attribute
+    on = create_switch(:state =&gt; 'on')
+    off = create_switch(:state =&gt; 'off')
+    unsure = create_switch(:state =&gt; 'unsure')
+    
+    assert_equal [unsure], Switch.without_states('on', 'off')
+  end
+  
   def test_should_raise_exception_if_invalid_option_specified
     assert_raise(ArgumentError) {PluginAWeek::StateMachine::Machine.new(Switch, 'state', :invalid =&gt; true)}
   end
@@ -145,6 +160,14 @@ class MachineWithConflictingNamedScopesTest &lt; Test::Unit::TestCase
     def self.with_states
       :custom
     end
+    
+    def self.without_state
+      :custom
+    end
+    
+    def self.without_states
+      :custom
+    end
   end
   
   def setup
@@ -155,6 +178,14 @@ class MachineWithConflictingNamedScopesTest &lt; Test::Unit::TestCase
     assert_equal :custom, Switch.with_state
   end
   
+  def test_should_not_define_a_named_scope_for_excluding_the_attribute
+    assert_equal :custom, Switch.without_state
+  end
+  
+  def test_should_not_define_a_pluralized_named_scope_for_excluding_the_attribute
+    assert_equal :custom, Switch.without_states
+  end
+  
   def test_should_not_define_a_pluralized_named_scope_for_the_attribute
     assert_equal :custom, Switch.with_states
   end</diff>
      <filename>test/unit/machine_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6d213798a6088c75c2f882fcef4b67bb2275464a</id>
    </parent>
  </parents>
  <author>
    <name>Sean O'Brien</name>
    <email>sean.obrien56@yahoo.com</email>
  </author>
  <url>http://github.com/pluginaweek/state_machine/commit/13a0906c1186ce9250b508296d4a860edc097c93</url>
  <id>13a0906c1186ce9250b508296d4a860edc097c93</id>
  <committed-date>2008-11-10T13:11:04-08:00</committed-date>
  <authored-date>2008-11-10T13:11:04-08:00</authored-date>
  <message>added support for without_#{state} scopes</message>
  <tree>010ea8b41d94a8512b654087bf5c4e53aad6a2dc</tree>
  <committer>
    <name>Sean O'Brien</name>
    <email>sean.obrien56@yahoo.com</email>
  </committer>
</commit>
