Skip to content

Instantly share code, notes, and snippets.

View x44x45x41x4E's full-sized avatar

Dean Canlas x44x45x41x4E

  • Manila, Philippines
View GitHub Profile
@x44x45x41x4E
x44x45x41x4E / import.rb
Last active August 29, 2015 14:05
For importing User IDs and Item IDs to PredictionIO
#Change appropriate settings in the ActiveRecord connection and your appkey.
#Credits to David Workman (https://github.com/workmad3)
#for giving me a faster query than the find_each method
require 'predictionio'
require 'active_record'
require 'pg'
ActiveRecord::Base.establish_connection(
adapter: 'postgresql',