Hi, Jeremy!
Gemfile:
source 'https://rubygems.org'
gem 'sequel', '4.12'
gem 'sqlite3'
test.rb:
require 'rubygems'
require 'bundler/setup'
require 'sequel'
require 'json'
Sequel::Model.db = Sequel.sqlite
Sequel::Model.db.create_table(:tests){
primary_key :id
varchar :name
text :data
}
class Test < Sequel::Model(:tests)
plugin :serialization
serialize_attributes :json, :data
def before_save
self.data ||= [1, 2]
super
end
end
p Sequel::VERSION
t = Test.create(name: 'foo')
p t
Now I open console, run 'bundle install', then 'ruby test.rb' and got
*"4.12.0"#<Test @values={:id=>1, :name=>"foo", :data=>"[1,2]"}>*
But with sequel 4.13 up to 4.18 (change in Gemfile) with 'ruby test.rb' i
got
*"4.18.0"#<Test @values={:id=>1, :name=>"foo", :data=>nil}>*
Is this behaviour correct or this is a bug?
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.