Created
March 12, 2014 07:12
-
-
Save juno/9502223 to your computer and use it in GitHub Desktop.
Revisions
-
juno created this gist
Mar 12, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ source 'https://rubygems.org' ruby '2.1.1' gem 'activerecord', '4.0.4.rc1' gem 'pg', '0.17.1' This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ # Activate the gem you are reporting the issue against. gem 'activerecord', '4.0.4.rc1' require 'active_record' require 'minitest/autorun' require 'logger' # Ensure backward compatibility with Minitest 4 Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) # This connection will do for database-independent bug reports. ActiveRecord::Base.establish_connection('postgres://username:password@hostname/dbname') ActiveRecord::Base.logger = Logger.new(STDOUT) ActiveRecord::Schema.define do create_table :posts, force: true do |t| t.string :tags, array: true, default: '{}' end end class Post < ActiveRecord::Base end class BugTest < Minitest::Test def test_empty_array_member post = Post.create! post.tags = ['foo', 'bar', 'baz', ''] post.save! post.reload assert_equal 4, post.tags.count end end