<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -37,6 +37,8 @@ end
 
 Now you can safely use &lt;code&gt; User.new(params[:user])&lt;/code&gt; in your controller to mass assign only the attributes you've said are safe.
 
+You should use allow_assignment in every controller within your application. By default bouncer will strip everything from the params hash that isn't required by rails to operate.
+
 Why Not Use attr_accessible?
 ==========================
 
@@ -74,3 +76,5 @@ end
 &lt;/pre&gt;
 
 Copyright (c) 2009 Gareth Townsend, released under the MIT license
+
+Thanks to Josh Bassett for helping nut out &lt;code&gt;self.request.env['rack.routing_args'].keys&lt;/code&gt; and other refactorings.</diff>
      <filename>README.textile</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,9 @@
 # Bouncer
 
 class ActionController::Base
-  def self.allow_assignment(*assignable_attributes_hash)
+  before_filter :cache_params_hash
+  
+  def self.allow_assignment(*assignable_attributes_hash)    
     assignable_attributes_hash.each do |attribute_hash|
       attribute_hash.keys.each do |key|
         before_filter { |controller| controller.send(:slice_attributes_for, key, attribute_hash[key]) }
@@ -10,8 +12,18 @@ class ActionController::Base
   end
   
   private
+  
+  def cache_params_hash
+    @cached_params_hash = params.dup
+    keys = [:authenticity_token, :_method]
+    keys += self.request.env['rack.routing_args'].keys
+    params.slice!(*keys)
+  end
 
   def slice_attributes_for(params_hash_symbol, assignable_attributes)
-    params[params_hash_symbol].slice!(*assignable_attributes) if params[params_hash_symbol]
+    if @cached_params_hash[params_hash_symbol]
+      allowed_attributes = @cached_params_hash[params_hash_symbol].slice(*assignable_attributes) 
+      params[params_hash_symbol] = allowed_attributes
+    end
   end
 end</diff>
      <filename>lib/bouncer.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dadd9842aba7e42cd991aacee2b155dda9247ac3</id>
    </parent>
  </parents>
  <author>
    <name>Gareth Townsend</name>
    <email>quamen@gmail.com</email>
  </author>
  <url>http://github.com/quamen/bouncer/commit/894af7b5ae6ab432ad5f791a19694aa3399085e4</url>
  <id>894af7b5ae6ab432ad5f791a19694aa3399085e4</id>
  <committed-date>2009-04-28T03:38:01-07:00</committed-date>
  <authored-date>2009-04-28T03:31:15-07:00</authored-date>
  <message>Automatically strip all params that are not required by rails routing to operate.

Re-insert params defined as allowable by allow_assignment method call in controller.</message>
  <tree>08ad896fc626e6389b70e87d594b4db116b18b17</tree>
  <committer>
    <name>Gareth Townsend</name>
    <email>quamen@gmail.com</email>
  </committer>
</commit>
