Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop support for InheritedResource #370

Merged
merged 2 commits into from
Dec 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Unreleased
2.0.0 (TBD)

* Drop support for Rails < 4.2 (oliverklee)
* Drop support for InheritedResource (coorasse)

1.15.0 (June 13th, 2016)

Expand Down
1 change: 0 additions & 1 deletion lib/cancan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
require 'cancan/controller_additions'
require 'cancan/model_additions'
require 'cancan/exceptions'
require 'cancan/inherited_resource'

require 'cancan/model_adapters/abstract_adapter'
require 'cancan/model_adapters/default_adapter'
Expand Down
6 changes: 1 addition & 5 deletions lib/cancan/controller_additions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,7 @@ def skip_authorization(*args)
end

def cancan_resource_class
if ancestors.map(&:to_s).include? "InheritedResources::Actions"
InheritedResource
else
ControllerResource
end
ControllerResource
end

def cancan_skipper
Expand Down
20 changes: 0 additions & 20 deletions lib/cancan/inherited_resource.rb

This file was deleted.

5 changes: 0 additions & 5 deletions spec/cancan/controller_additions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@
expect(@controller.class.cancan_resource_class).to eq(CanCan::ControllerResource)
end

it "cancan_resource_class is InheritedResource when class includes InheritedResources::Actions" do
allow(@controller.class).to receive(:ancestors) { ["InheritedResources::Actions"] }
expect(@controller.class.cancan_resource_class).to eq(CanCan::InheritedResource)
end

it "cancan_skipper is an empty hash with :authorize and :load options and remember changes" do
expect(@controller_class.cancan_skipper).to eq({:authorize => {}, :load => {}})
@controller_class.cancan_skipper[:load] = true
Expand Down
71 changes: 0 additions & 71 deletions spec/cancan/inherited_resource_spec.rb

This file was deleted.