문제

I am using rails_admin and I have a list of objects
How would I sort by created_at >= 1.day.ago,

ie first show all users where created_at >= 1.day.ago then the rest

list do
  sort_by :created_at # created_at >= 1.day.ago
  field :id
  field :name
  field :address
  field :created_at
end
도움이 되었습니까?

해결책

It looks like what you're trying to do is actually a filter - sort_by only lets you order the results by a database column - whereas you want to filter out any objects that are older than a certain date.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top