sequel - 如何在 Sequel 中按降序排列关联
问题描述
鉴于这个类
class User < Sequel::Model
one_to_many :rounds, order: :date
end
我想做的是按日期降序排序。
我尝试过像 ActiveRecord 支持一样,但这不是要走的路。
one_to_many :rounds, order: date: :desc
一种解决方案是创建数据集方法,但我觉得必须有更好的方法来做到这一点。
解决方案
推荐阅读
- r - 将数据汇总为 R 中并排条形图的百分比
- python - 一种加快对 geopandas.read_file() 的 19 次调用的方法?
- java - Manifest.mf 和导入
- javascript - 如何从对象数组中获取数据,通过 API 端点将其传递给 .fetch() 使用 React 所需的对象值?
- typo3 - 将数据属性添加到 TYPO3 FORM 中的表单元素
- python - 寻找线性方程组的最接近解
- python - 在网格上获取像素邻域平均值的有效方法
- python - 使用python将实体名称分散在多行大文本文件中时如何提取实体名称
- php - php Include - 文件夹中的文件
- java - 打开 CSV Performance 写入数据