Created
August 15, 2018 20:39
-
-
Save arubis/976e20d7df333805be513e05c3202c41 to your computer and use it in GitHub Desktop.
This file contains 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 "rails_helper" | |
describe "index issue" do | |
with_model :MidsizeNameChild do | |
table do |t| | |
t.belongs_to :midsize_name_parent, | |
index: { name: "shorter_index_name" } | |
end | |
model do | |
belongs_to :midsize_name_parent | |
end | |
end | |
with_model :MidsizeNameParent do | |
model do | |
has_many :midsize_name_children | |
end | |
end | |
let(:instance) { MidsizeNameParent.create } | |
describe "try to instantiate" do | |
it "is an example" do | |
instance | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Demo working/broken usage of
with_model
on postgres backend. Dropping L7 (and the trailing comma on L6) will cause this to blow up due to generating an index with name >63 characters (PG9.6's limit).