Skip to content

Instantly share code, notes, and snippets.

@Austio
Created November 28, 2020 13:48
Show Gist options
  • Save Austio/86783b3f1b631323261c4cdfc5df2a1f to your computer and use it in GitHub Desktop.
Save Austio/86783b3f1b631323261c4cdfc5df2a1f to your computer and use it in GitHub Desktop.
Rails 1 file reproduction template
# 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 "rails", github: "rails/rails", branch: "master"
gem "sqlite3"
end
require "active_record"
require "minitest/autorun"
require "logger"
# This connection will do for database-independent bug reports.
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Schema.define do
create_table :posts, force: true do |t|
t.string :name
t.text :description
t.datetime :routing_start_date
t.datetime :routing_end_date
end
end
class Post < ActiveRecord::Base
has_many :comments
end
class BugTest < Minitest::Test
def test_association_stuff
post = Post.create!(name: [])
post.routing_start_date = DateTime::Infinity
assert_equal DateTime::Infinity, post.routing_start_date
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment