On 5 March 2014 00:32, John Merlino stoici...@aol.com wrote:
Initially, I was using this query:
report_ids = []
if units.size 0
units.map(:id).uniq.each do |id|
report_id = Report.select(:id).where(unit_id: id).order(time
desc).first
unless report_id.nil?
Initially, I was using this query:
report_ids = []
if units.size 0
units.map(:id).uniq.each do |id|
report_id = Report.select(:id).where(unit_id: id).order(time
desc).first
unless report_id.nil?
report_ids report_id
end
end
end
2 matches
Mail list logo