是否存在后缀运算符访问数组元素的arel节点,如下所示:
column = Table.arel_table[:column]
low = here_magic_happens(column, '[1]')
Table.where(low.eq nil).or(Table.where(low.gt 5))
# should result in this where clause:
# "table"."column"[1] IS NULL OR "table"."column"[1] > 5
是否存在后缀运算符访问数组元素的arel节点,如下所示:
column = Table.arel_table[:column]
low = here_magic_happens(column, '[1]')
Table.where(low.eq nil).or(Table.where(low.gt 5))
# should result in this where clause:
# "table"."column"[1] IS NULL OR "table"."column"[1] > 5
1条答案
按热度按时间slwdgvem1#
5年了,我还没找到比这更好的: