Permalink
Browse files

Make sure that params accessible and protected works also with string…

… keys
  • Loading branch information...
1 parent e3eb647 commit fc9b70afd243707fe4f79c16738fde624f847abf @drogus committed Sep 20, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/bulk/resource.rb
  2. +1 −1 spec/bulk/resource_spec.rb
View
@@ -266,7 +266,7 @@ def filter_params_for(type, attributes)
if filter
attributes.delete_if do |k, v|
- delete_if = filter.include?(k)
+ delete_if = filter.include?(k.to_sym)
type == :accessible ? !delete_if : delete_if
end
end
@@ -329,7 +329,7 @@ def params_accessible(klass)
it "should pass only params that are returned by params_accessible" do
params = {
- :projects => [{:_local_id => '10', :name => 'SproutCore', :description => 'Great project'}],
+ :projects => [{:_local_id => '10', 'name' => 'SproutCore', :description => 'Great project'}],
:tasks => [{:_local_id => '5', :title => 'My task', :done => true }]
}
controller = mock("controller", :params => params)

0 comments on commit fc9b70a

Please sign in to comment.