Skip to content

Commit

Permalink
Use Arel.sql to avoid UnknownAttributeReference
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSiemers-msr committed Jun 2, 2022
1 parent fca30eb commit 12b4526
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/job-iteration/active_record_batch_enumerator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def initialize(relation, columns: nil, batch_size: 100, cursor: nil)
raise ConditionNotSupportedError
end

@base_relation = relation.reorder(@columns.join(","))
@base_relation = relation.reorder(Arel.sql(@columns.join(",")))
end

def each
Expand Down
2 changes: 1 addition & 1 deletion lib/job-iteration/active_record_cursor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def initialize(relation, columns = nil, position = nil)
raise ConditionNotSupportedError
end

@base_relation = relation.reorder(@columns.join(","))
@base_relation = relation.reorder(Arel.sql(@columns.join(",")))
@reached_end = false
end

Expand Down

0 comments on commit 12b4526

Please sign in to comment.