Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Fixed bug with params for actions that build new instances with namespaced models #541

Merged
merged 1 commit into from
May 10, 2012
Merged

Conversation

icrowley
Copy link
Contributor

@icrowley icrowley commented Jan 5, 2012

Fixed bug with params for actions that build new instances with namespaced models

For example, I have a model Sub::Project and make the following call:
load_resource :instance_name => :project, :class => Sub::Project

when in the 'create' action CanCan waits for params[:project], no params[:sub_project]

This patch fixes it

@cgunther
Copy link
Contributor

I just hit this same bug.

The patch fixes it, but only if the class option is passed in, which I feel may be redundant.

Given a controller Accessory::ColorsController and a model Accessory::Color, I don't believe it should be necessary to pass in the class option.

I'll do some digging in the source and see what I can come up with.

ryanb added a commit that referenced this pull request May 10, 2012
Fixed bug with params for actions that build new instances with namespaced models
@ryanb ryanb merged commit a8a85f1 into ryanb:master May 10, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants