Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor out attribute assignment

  • Loading branch information...
commit 88aba4664aa15b11d54c55ebb7c30af31a59b97b 1 parent b965f5b
@mikepack mikepack authored andhapp committed
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
Please sign in to comment.
Something went wrong with that request. Please try again.