Skip to content

Commit

Permalink
Merge pull request #1 from tuned-up/fix_for_multiple_decorations
Browse files Browse the repository at this point in the history
Fix for multiple decorations
  • Loading branch information
robmathews committed Apr 18, 2016
2 parents a416ecf + 8d660a6 commit 4542718
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/draper/cancancan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

module Draper
module CanCanCan
# actually don't need any code in my gem's namespace ..
# actually don't need any code in my gem's namespace ..
def can?(action, subject, *extra_args)
if subject.is_a?(Draper::Decorator)
super(action,subject.model,*extra_args)
else
super(action,subject,*extra_args)
while subject.is_a?(Draper::Decorator)
subject = subject.model
end

super(action, subject, *extra_args)
end

def cannot?(*args)
Expand Down
2 changes: 1 addition & 1 deletion lib/draper/cancancan/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Draper
module CanCanCan
VERSION = "1.0.1"
VERSION = "1.1.1"
end
end

0 comments on commit 4542718

Please sign in to comment.