Skip to content

Instantly share code, notes, and snippets.

@rjhornsby
Created August 12, 2015 21:00
Show Gist options
  • Save rjhornsby/26addcbaef5459182947 to your computer and use it in GitHub Desktop.
Save rjhornsby/26addcbaef5459182947 to your computer and use it in GitHub Desktop.
class Track < ActiveRecord::Base
self.table_name = 'SONGLIST'
has_one :supplemental
end
class Supplemental < ActiveRecord::Base
self.table_name = 'amazon_metadata'
belongs_to :track
end
Track.where(upc: '699675115623').find_each do |track|
pp track.supplemental.asin
..
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment