Skip to content
Permalink
Browse files Browse the repository at this point in the history
Allow specific ransack queries
  • Loading branch information
hellcp committed Nov 29, 2022
1 parent a373d75 commit d229162
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/models/application_record.rb
@@ -1,3 +1,11 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true

def self.ransackable_attributes(_)
super & %w[end_date start_date name description event_id state]
end

def self.ransackable_associations(_)
[]
end
end
4 changes: 4 additions & 0 deletions app/models/reimbursement.rb
Expand Up @@ -239,4 +239,8 @@ def reject_request(attrs)
end
false
end

def self.ransackable_associations(_)
%w[request]
end
end

0 comments on commit d229162

Please sign in to comment.