Permalink
Browse files

fixing #577

  • Loading branch information...
1 parent 5f1be25 commit 4f1893f810957a52219f8e2beb9f52d8fa03e04e @ramaboo ramaboo committed with andhapp Apr 12, 2012
Showing with 4 additions and 1 deletion.
  1. +3 −0 lib/cancan/controller_additions.rb
  2. +1 −1 lib/cancan/controller_resource.rb
@@ -112,6 +112,9 @@ def load_and_authorize_resource(*args)
# [:+prepend+]
# Passing +true+ will use prepend_before_filter instead of a normal before_filter.
#
+ # [:+assignment+]
+ # Passing to ActiveRecord for support Mass-Assignment Role
+ #
def load_resource(*args)
cancan_resource_class.add_before_filter(self, :load_resource, *args)
end
@@ -82,7 +82,7 @@ def load_collection
end
def build_resource
- resource = resource_base.new(resource_params || {})
+ resource = resource_base.new(@params[name] || {}, :as => @options[:assignment])
assign_attributes(resource)
end

0 comments on commit 4f1893f

Please sign in to comment.