Skip to content

Instantly share code, notes, and snippets.

@rohitn
Created April 3, 2012 13:54
Show Gist options
  • Save rohitn/2292202 to your computer and use it in GitHub Desktop.
Save rohitn/2292202 to your computer and use it in GitHub Desktop.
Backwards incompatible change in Sequel 3.34.1
#!/usr/bin/env ruby
require 'rubygems'
if ARGV[0]
gem 'sequel', '= 3.34.1'
else
gem 'sequel', '= 3.33.0'
end
require 'sequel'
p "Sequel version: #{Sequel.version}"
DB = Sequel.sqlite
DB.create_table :a_items do
String :name
end
DB.create_table :b_items do
String :name
end
DB[:a_items].insert(:name => 'abc')
class AItems < Sequel::Model; end
class BItems < Sequel::Model; end
# Sequel 3.33 allows a model instance to be created from another model instance
# Sequel 3.34.1 only allows a hash or hash-like that responds to empty?
# Change here https://github.com/jeremyevans/sequel/commit/bf563a716893d27e7f7ef4d0ae08f1a235ae7a91
BItems.create(AItems.first)
p BItems.first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment