Skip to content

Instantly share code, notes, and snippets.

@SynnaxCrab
Created June 7, 2012 07:08
Show Gist options
  • Save SynnaxCrab/2887078 to your computer and use it in GitHub Desktop.
Save SynnaxCrab/2887078 to your computer and use it in GitHub Desktop.
1715.rb
require 'sequel'
require 'active_support/core_ext'
module Sequel
class Model
def empty?
puts "Using undocumented Sequel behavior\n" + caller(0).join("\n")
self.values.empty?
end
end
end
DB = Sequel.connect(:adapter => 'jdbc',
:driver => 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
:username => 'read_only',
:password => 'read_only',
:uri => 'XXX')
p 'connecting'
class Offer < Sequel::Model; end
class Company < Sequel::Model; end
p Offer.superclass
Company.create(Offer.first)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment