Skip to content

Instantly share code, notes, and snippets.

@alexcameron89
Created March 26, 2019 18:07
Show Gist options
  • Save alexcameron89/9232a1f398ac713adcd02a4c1372b262 to your computer and use it in GitHub Desktop.
Save alexcameron89/9232a1f398ac713adcd02a4c1372b262 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
gem "activerecord", "5.2.2.1"
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: "rails")
ActiveRecord::Base.logger = Logger.new(STDOUT)
class CreateFoos < ActiveRecord::Migration[5.2]
def change
create_table :foos do |t|
t.numeric :bar, default: 0.0
t.decimal :baz, default: 0.0
end
end
end
class BugTest < Minitest::Test
def test_migration_up
CreateFoos.migrate(:up)
end
def test_migration_down
CreateFoos.migrate(:down)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment