<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -106,9 +106,13 @@ module ThoughtBot # :nodoc:
         attributes.each do |attribute|
           attribute = attribute.to_sym
           should &quot;protect #{attribute} from mass updates&quot; do
-            protected_attributes = klass.protected_attributes || []
-            assert protected_attributes.include?(attribute.to_s), 
-                   &quot;#{klass} is protecting #{protected_attributes.to_a.to_sentence}, but not #{attribute}.&quot;
+            protected = klass.protected_attributes || []
+            accessible = klass.accessible_attributes || []
+
+            assert protected.include?(attribute.to_s) || !accessible.include?(attribute.to_s),
+                   (accessible.empty? ?
+                     &quot;#{klass} is protecting #{protected.to_a.to_sentence}, but not #{attribute}.&quot; :
+                     &quot;#{klass} has made #{attribute} accessible&quot;)
           end
         end
       end</diff>
      <filename>lib/shoulda/active_record_helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,4 +3,6 @@ class Tag &lt; ActiveRecord::Base
   has_many :posts, :through =&gt; :taggings
   
   validates_length_of :name, :minimum =&gt; 2
+
+  attr_accessible :name
 end</diff>
      <filename>test/rails_root/app/models/tag.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,4 +7,6 @@ class TagTest &lt; Test::Unit::TestCase
   should_have_many :posts
   
   should_ensure_length_at_least :name, 2
+
+  should_protect_attributes :secret
 end</diff>
      <filename>test/unit/tag_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>051edf42e8d5d8ccddffe96660a4effe5efac25f</id>
    </parent>
  </parents>
  <author>
    <name>Mike Boone</name>
    <email>mike@boonedocks.net</email>
  </author>
  <url>http://github.com/boone/shoulda/commit/2a7de9cca8fc688bd9f6741128005ab91af37e9a</url>
  <id>2a7de9cca8fc688bd9f6741128005ab91af37e9a</id>
  <committed-date>2008-05-11T16:48:57-07:00</committed-date>
  <authored-date>2008-05-11T16:48:57-07:00</authored-date>
  <message>should_protect_attributes works with attr_accessible

Applied Luke Francl's patch from this Lighthouse ticket:
http://thoughtbot.lighthouseapp.com/projects/5807/tickets/25-patch-make-should_protect_attributes-with-attr_accessible

Also modified to tag model to use attr_accessible and added a
should_protect_attributes test to tag's unit test.</message>
  <tree>6acfe9c7d96e1ea8a1ceec6e5a82dbcf00e8e94f</tree>
  <committer>
    <name>Mike Boone</name>
    <email>mike@boonedocks.net</email>
  </committer>
</commit>
