Permalink
Browse files

Refactor out attribute assignment

  • Loading branch information...
1 parent b965f5b commit 88aba4664aa15b11d54c55ebb7c30af31a59b97b @mikepack mikepack committed with andhapp Jun 8, 2012
Showing with 1 addition and 4 deletions.
  1. +1 −4 lib/cancan/inherited_resource.rb
View
5 lib/cancan/inherited_resource.rb
@@ -7,10 +7,7 @@ def load_resource_instance
@controller.instance_variable_get("@#{instance_name}")
elsif new_actions.include? @params[:action].to_sym
resource = @controller.send :build_resource
- initial_attributes.each do |attr_name, value|
- resource.send("#{attr_name}=", value)
- end
- resource
+ assign_attributes(resource)
else
@controller.send :resource
end

0 comments on commit 88aba46

Please sign in to comment.