Created
September 27, 2013 07:51
-
-
Save senny/6725398 to your computer and use it in GitHub Desktop.
Reproduction for https://github.com/rails/rails/issues/12261
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 characters
require 'bundler' | |
Bundler.setup(:default) | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'postgresql', database: 'rails_bug') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Schema.define do | |
drop_table "posts" | |
create_table :posts do |t| | |
t.string :tags, array: true | |
end | |
end | |
class Post < ActiveRecord::Base | |
has_many :comments | |
end | |
class BugTest < Minitest::Test | |
def test_array_stuff | |
post = Post.create!(tags: ["one", "two", "three"]) | |
post.update_column(:tags, ["four", "five"]) | |
assert_equal ["four", "five"], Post.first.tags | |
end | |
end |
This investigation was related to: https://meta.discourse.org/t/search-not-working-for-staff-users/11371/5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This fails with (tested against rails/rails@7045a5b ):