Skip to content

Instantly share code, notes, and snippets.

@utilum
Created March 23, 2018 21:14
Show Gist options
  • Save utilum/d7bebde6a754095704396d6404ced8b9 to your computer and use it in GitHub Desktop.
Save utilum/d7bebde6a754095704396d6404ced8b9 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'rails', '5.1.5'
gem "pg"
end
require "active_record"
require "minitest/autorun"
require "logger"
# This connection will do for database-independent bug reports.
ActiveRecord::Base.establish_connection(adapter: "postgresql", database: "my_database")
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Schema.define do
create_table :posts, force: true do |t|
end
end
class Post < ActiveRecord::Base
attribute :foo, :string, array: true
end
class BugTest < Minitest::Test
def test_association_stuff
assert_equal Post.attribute_names.include?('foo'), true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment