Created
September 20, 2018 12:09
-
-
Save r7kamura/83c922e9a16b173000fadc3bbeb49ab0 to your computer and use it in GitHub Desktop.
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/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "activerecord", "5.2.1", require: "active_record" | |
gem "sqlite3" | |
end | |
ActiveRecord::Base.establish_connection( | |
adapter: "sqlite3", | |
database: ":memory:", | |
) | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Migration[4.2].create_table :ar42s do |t| | |
t.timestamps | |
end | |
ActiveRecord::Migration[5.2].create_table :ar52s do |t| | |
t.timestamps | |
end | |
class Ar42 < ActiveRecord::Base | |
end | |
class Ar52 < ActiveRecord::Base | |
end | |
require "minitest/autorun" | |
class ExampleTest < Minitest::Test | |
def test_ar42_timestamps_nullability | |
created_at_column = Ar42.columns[1] | |
assert(created_at_column.null) | |
end | |
def test_ar52_timestamps_nullability | |
created_at_column = Ar52.columns[1] | |
assert(!created_at_column.null) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.