spec & fix for params[:controller] in underscore format #681

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
@joxxoxo

joxxoxo commented Jul 5, 2012

code supposed that @params[:controller] is in camel case, but actually in rails it's in snake case

so i added .camelize in some methods

@joxxoxo

This comment has been minimized.

Show comment
Hide comment
@joxxoxo

joxxoxo Apr 8, 2013

Exactly! But code in cancan

@params[:controller].split("::")[0..-2]

splits it by :: as if it was MyEngine::ProjectsController

looks like there's also unnecessary .gsub('Controller', '') in such case.
But I'm not sure if anyone needs this patch except me

joxxoxo commented Apr 8, 2013

Exactly! But code in cancan

@params[:controller].split("::")[0..-2]

splits it by :: as if it was MyEngine::ProjectsController

looks like there's also unnecessary .gsub('Controller', '') in such case.
But I'm not sure if anyone needs this patch except me

@stevenpetryk

View changes

spec/cancan/controller_resource_spec.rb
+ @params.merge!(:controller => "my_engine/projects_controller", :action => "show", :id => project.id)
+ resource = CanCan::ControllerResource.new(@controller)
+ resource.load_resource
+ @controller.instance_variable_get(:@project).should == project

This comment has been minimized.

@stevenpetryk

stevenpetryk Apr 9, 2013

IIRC, @ryanb prefers to use .should eq instead of .should ==

@stevenpetryk

stevenpetryk Apr 9, 2013

IIRC, @ryanb prefers to use .should eq instead of .should ==

@joxxoxo

This comment has been minimized.

Show comment
Hide comment
@joxxoxo

joxxoxo Apr 10, 2013

I've rebased against ryanb / cancan and changed == to eq :)

joxxoxo commented Apr 10, 2013

I've rebased against ryanb / cancan and changed == to eq :)

@xhoy

This comment has been minimized.

Show comment
Hide comment
@xhoy

xhoy Apr 10, 2014

Dear submitter, Since cancan/raynB hasn't been active for more than 6 months and no body else then ryam himself has commit permissions the cancan project is on a stand still.
Since cancan has several issues including missing support for rails 4 cancan is moving forward to cancancan. More details on: #994

If your feel that your pull request or bug is still applicable (and hasn't been merged in to cancan) it would be really appreciated if you would resubmit it to cancancan (https://github.com/cancancommunity/cancancan)

We hope to see you on the other side!

xhoy commented Apr 10, 2014

Dear submitter, Since cancan/raynB hasn't been active for more than 6 months and no body else then ryam himself has commit permissions the cancan project is on a stand still.
Since cancan has several issues including missing support for rails 4 cancan is moving forward to cancancan. More details on: #994

If your feel that your pull request or bug is still applicable (and hasn't been merged in to cancan) it would be really appreciated if you would resubmit it to cancancan (https://github.com/cancancommunity/cancancan)

We hope to see you on the other side!

@joxxoxo joxxoxo closed this Feb 13, 2016

@joxxoxo

This comment has been minimized.

Show comment
Hide comment
@joxxoxo

joxxoxo Feb 13, 2016

Closed, as it's fixed differently in cancancan

joxxoxo commented Feb 13, 2016

Closed, as it's fixed differently in cancancan

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