daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Jan 25th, 2016 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # encoding: UTF-8
  2. require 'json'
  3. require 'tzinfo'
  4. require 'sinatra'
  5. require 'sequel'
  6. require 'sinatra/reloader'
  7. require 'pry'
  8. require './methods'
  9.  
  10.  
  11. Sequel.extension :named_timezones
  12. Sequel.application_timezone = 'America/Los_Angeles'
  13. DB = Sequel.connect('mysql2://localhost/promoter_development?user=root&password=')
  14.  
  15. get '/hi' do
  16.     coun = []
  17.     dataset = DB.from(:countries).select(:id, :name_uk, :created_at)
  18.  
  19.     binding.pry
  20.     dataset.to_a.to_json
  21. end
  22.  
  23.  
  24. # this return
  25. #=> [{:created_at=>2014-04-24 09:05:07 +0300}, {:created_at=>2014-10-16 14:34:45 +0300}, {:created_at=>2015-06-26 13:30:15 +0300}]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top