Skip to content
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ gem "mysql2"
# gem "ruby-oci8" # only for CRuby users

## auth
gem "cancancan", "3.1.0"
gem "cancancan", "3.6.1"
gem "devise"
gem "devise-encryptable"
gem "devise-security"
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ GEM
uniform_notifier (~> 1.11)
byebug (13.0.0)
reline (>= 0.6.0)
cancancan (3.1.0)
cancancan (3.6.1)
capybara (3.40.0)
addressable
matrix
Expand Down Expand Up @@ -747,7 +747,7 @@ DEPENDENCIES
bulk_email!
bullet
c2po!
cancancan (= 3.1.0)
cancancan (= 3.6.1)
capybara
capybara-email
chosen-rails
Expand Down
10 changes: 10 additions & 0 deletions config/initializers/cancancan.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

# CanCanCan 3.4+ makes rules defined on an STI subclass also match class-level
# `can?` checks against the parent. If a rule targets an STI child (say OfflineReservation),
# that rule now also matches when the check subject is the STI parent class (Reservation).
StiDetector.singleton_class.prepend(Module.new do
def sti_class?(_subject)
false
end
end)
Loading