Skip to content

Commit adeb9d0

Browse files
author
Evan Radkoff
committed
Fix docbot list page. Apparently after a major version upgrade of Ransack we have to be more explicit about what fields can be used for searches
1 parent 5a76d8b commit adeb9d0

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

app/models/case.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ class Case < ApplicationRecord
44

55
has_many :case_comments, dependent: :destroy
66

7+
def self.ransackable_attributes(auth_object = nil)
8+
%w[title]
9+
end
10+
711
def self.search_by_multiple(query)
812
Case.where("title ILIKE ? or description ILIKE ?", "%#{query}%", "%#{query}%")
913
end

app/models/point.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Point < ApplicationRecord
2121
scope :eager_loaded_nouser, -> { includes(:case, :service) }
2222

2323
def self.ransackable_associations(auth_object = nil)
24-
["service"]
24+
["service", "case"]
2525
end
2626

2727
def self.ransackable_attributes(auth_object = nil)

db/schema.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@
226226
end
227227

228228
create_table "versions", force: :cascade do |t|
229-
t.string "item_type", null: false
229+
t.string "item_type"
230+
t.string "{:null=>false}"
230231
t.integer "item_id", null: false
231232
t.string "event", null: false
232233
t.string "whodunnit"

0 commit comments

Comments
 (0)