Skip to content

Commit

Permalink
Merge pull request #3 from D4uS1/fix/ransack_v4_privacy_by_default
Browse files Browse the repository at this point in the history
* [Ransack] fixing new Ransack 4 privacy by default
  • Loading branch information
D4uS1 authored Feb 17, 2023
2 parents 17e0d27 + c54e63d commit 32573db
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions EzOnRails/app/models/ez_on_rails/application_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,18 @@ class EzOnRails::ApplicationRecord < ActiveRecord::Base
def self.search_keys
columns_hash.keys.map(&:to_sym)
end

# Returns all ransackable attributes the old way before Ransack moved to version 4
# with new privacy by default settings, blocking all attributes by default instead
# of allowing all by default.
def self.ransackable_attributes
authorizable_ransackable_attributes
end

# Returns all ransackable associations the old way before Ransack moved to version 4
# with new privacy by default settings, blocking all associations by default instead
# of allowing all by default.
def self.ransackable_associations
authorizable_ransackable_associations
end
end

0 comments on commit 32573db

Please sign in to comment.