Ransack 过滤自定义字段

我有一个 Data::Users 对象类型:

  id: "0e00392b-4205-43d1-8969-b6c7f2a92d8b",identifier: "bb7b38dc-bc21-4386-98a4-8d9738c11d5c",properties:
   {"name"=>"Vern Lueilwitz","email"=>"carmen@altenwerth-batz.org","last_time_entry_on"=>"2021-06-26","liked_videos_count"=>201,"played_videos_count"=>609,"viewed_photos_count"=>143},created_at: Sat,31 Jul 2021 17:24:48.836493000 UTC +00:00,updated_at: Sat,

当我尝试时:

 Data::User.ransackable_attributes

我得到了字段:["id","identifier","created_at","updated_at","properties"]

属性是一个自定义的 json,可以包含任何键和值。它是从另一台服务器获取的。我希望能够搜查这些自定义字段。我可以通过什么方式扩展 ransack 以允许过滤那些不在我的表上的字段?

qaz1321 回答:Ransack 过滤自定义字段

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2991.html

大家都在问