Skip to content

Commit 12b4526

Browse files
Use Arel.sql to avoid UnknownAttributeReference
1 parent fca30eb commit 12b4526

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/job-iteration/active_record_batch_enumerator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def initialize(relation, columns: nil, batch_size: 100, cursor: nil)
2929
raise ConditionNotSupportedError
3030
end
3131

32-
@base_relation = relation.reorder(@columns.join(","))
32+
@base_relation = relation.reorder(Arel.sql(@columns.join(",")))
3333
end
3434

3535
def each

lib/job-iteration/active_record_cursor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def initialize(relation, columns = nil, position = nil)
3131
raise ConditionNotSupportedError
3232
end
3333

34-
@base_relation = relation.reorder(@columns.join(","))
34+
@base_relation = relation.reorder(Arel.sql(@columns.join(",")))
3535
@reached_end = false
3636
end
3737

0 commit comments

Comments
 (0)