Skip to content

Commit

Permalink
Fix pull request 640. For some reason github didn't allow a clean mer…
Browse files Browse the repository at this point in the history
…ge althought there weren't any conflicts. Fix it so that it's easier to just merge via the UI.
  • Loading branch information
andhapp committed Jun 18, 2012
1 parent 88aba46 commit a1254ca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/cancan/controller_resource.rb
Expand Up @@ -83,6 +83,10 @@ def load_collection

def build_resource
resource = resource_base.new(resource_params || {})
assign_attributes(resource)
end

def assign_attributes(resource)
resource.send("#{parent_name}=", parent_resource) if @options[:singleton] && parent_resource
initial_attributes.each do |attr_name, value|
resource.send("#{attr_name}=", value)
Expand Down

0 comments on commit a1254ca

Please sign in to comment.