Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix pull request 640. For some reason github didn't allow a clean mer…

…ge althought there weren't any conflicts. Fix it so that it's easier to just merge via the UI.
  • Loading branch information...
commit a1254ca1c63276adab09d03d12413972da7ac837 1 parent 88aba46
@andhapp andhapp authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/cancan/controller_resource.rb
View
4 lib/cancan/controller_resource.rb
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.