Created
April 3, 2012 13:54
-
-
Save rohitn/2292202 to your computer and use it in GitHub Desktop.
Backwards incompatible change in Sequel 3.34.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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