Skip to content

Add manage to default aliases #688

Closed
wants to merge 2 commits into from
View
1 lib/cancan/ability.rb
@@ -341,6 +341,7 @@ def default_aliases
:create => [:new],
:update => [:edit],
:destroy => [:delete],
+ :manage => [:index, :show, :new, :edit, :delete]
}
}
end
View
3 spec/cancan/model_adapters/mongoid_adapter_spec.rb
@@ -72,15 +72,14 @@ class MongoidProject
end
it "returns the correct records when a mix of can and cannot rules in defined ability" do
- pending "TODO figure out why this isn't working"
@ability.can :manage, :mongoid_projects, :title => 'Sir'
@ability.cannot :destroy, :mongoid_projects
sir = MongoidProject.create(:title => 'Sir')
lord = MongoidProject.create(:title => 'Lord')
dude = MongoidProject.create(:title => 'Dude')
- MongoidProject.accessible_by(@ability, :destroy).entries.should == [sir]
+ MongoidProject.accessible_by(@ability, :delete).entries.should == [sir]
@suweller
suweller added a note Jul 23, 2012

This still applies though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
end
it "is able to mix empty conditions and hashes" do
Something went wrong with that request. Please try again.