Use qualified column name when convertin resoures to job args

parent 4c3c2051
......@@ -15,7 +15,7 @@ module Geo
# rubocop: disable CodeReuse/ActiveRecord
def convert_resource_relation_to_job_args(relation)
relation.pluck(:id, :uploader)
.map { |id, uploader| [uploader.sub(/Uploader\z/, '').underscore, id] }
.map! { |id, uploader| [uploader.sub(/Uploader\z/, '').underscore, id] }
end
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -50,13 +50,13 @@ module Geo
# rubocop: disable CodeReuse/ActiveRecord
def convert_resource_relation_to_job_args(relation)
relation.pluck(:id).map { |id| [self.class::FILE_SERVICE_OBJECT_TYPE.to_s, id] }
relation.pluck(relation.model.arel_table[:id]).map! { |id| [self.class::FILE_SERVICE_OBJECT_TYPE.to_s, id] }
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
def convert_registry_relation_to_job_args(relation)
relation.pluck(self.class::RESOURCE_ID_KEY).map { |id| [self.class::FILE_SERVICE_OBJECT_TYPE.to_s, id] }
relation.pluck(self.class::RESOURCE_ID_KEY).map! { |id| [self.class::FILE_SERVICE_OBJECT_TYPE.to_s, id] }
end
# rubocop: enable CodeReuse/ActiveRecord
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment