Skip to content

Commit 51d8f8e

Browse files
committed
ActiveRecordEnumerator no longer accepts Arel columns as input
Arel is a private API and shouldn't be used to as input types.
1 parent 408712e commit 51d8f8e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/job-iteration/active_record_enumerator.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ def initialize(relation, columns: nil, batch_size: 100, cursor: nil)
1111
@relation = relation
1212
@batch_size = batch_size
1313
@columns = if columns
14-
Array(columns).map do |column|
15-
if column.is_a?(Arel::Attributes::Attribute)
16-
column
17-
else
18-
relation.arel_table[column.to_sym]
19-
end
20-
end
14+
Array(columns).map { |col| relation.arel_table[col.to_sym] }
2115
else
2216
Array(relation.primary_key).map { |pk| relation.arel_table[pk.to_sym] }
2317
end

0 commit comments

Comments
 (0)