This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
range = Date.new(2014,12,1)..Date.new(2014,12,31) | |
# Gets the list of businesses that ran ads in "range" and the ad count | |
Business.joins(:ads).where(ads: {publisher_id: 365, start_date:range}).uniq.map do |business| | |
"#{business.name}, #{business.ads.where(publisher_id: 365, start_date: range).count}" | |
end.each { |elem| puts elem }; 1 | |
# Gets the list of ads that ran for a given publisher with the business name, business uuid | |
Business.joins(:ads).where(ads: {publisher_id: 365, start_date:range}).uniq.each do |business| | |
puts "#{business.uuid},#{business.name},#{business.custom_id}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
location: { | |
city: "Austin", | |
state: "TX" | |
}, | |
results: [ | |
{ | |
"type": "Business", | |
"id": "a41be902-d385-4ff8-b3b7-f1d0d2e43209", | |
"name": "Orland Park Cyclery", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 3 # amount of unicorn workers to spin up | |
timeout 30 # restarts workers that hang for 30 seconds | |
preload_app true | |
GC.respond_to?(:copy_on_write_friendly=) and | |
GC.copy_on_write_friendly = true | |
before_fork do |server,worker| | |
defined?(ActiveRecord::Base) and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
ruby '1.9.3' | |
gem 'rails', '3.2.11' | |
gem 'pg' | |
gem 'unicorn' | |
gem 'rmagick' | |
gem 'carrierwave', git: "git://github.com/jnicklas/carrierwave.git" | |
gem 'fog' | |
gem 'devise' |