Skip to content

Commit

Permalink
Refactor out attribute assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepack authored and andhapp committed Jun 18, 2012
1 parent b965f5b commit 88aba46
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/cancan/inherited_resource.rb
Expand Up @@ -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
Expand Down

0 comments on commit 88aba46

Please sign in to comment.