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

Merged
merged 1 commit into from May 10, 2012

Conversation

Projects
None yet
3 participants
Contributor

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

Contributor

cgunther commented Jan 31, 2012

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 merged commit a8a85f1 into ryanb:master May 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment