Search Queries last 10 days
output = []; (1..10).each{|i| output.push(Search.where(created_at: ((DateTime.now-i.days)..(DateTime.now-(i-1).days))).count)};output
Create Fares for provider X
This process is required when batch loading in maintaining fares is conducted
Excel:
="["&B3&","&C3&","&D3&"]"
="["&E3
=F3&","&E4
=F53&"]"
Ruby:
p = Provider.find(X)
ary = [{:departure_place_id}, {:arrival_place_id}, {:price_per_seat}]
ary.each{|e| p.fares.create!(departure_place:Place.find(e[0]), arrival_place:Place.find(e[1]), price_per_seat: e[2])}
Posted by Julian Hauck to Distribusion IT (2013-10-11 08:11)