Skip to content

Instantly share code, notes, and snippets.

@Austio

Austio/Rails.rd

Created Nov 28, 2020
Embed
What would you like to do?
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