Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/schema_plus/core/active_record/schema_dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def tables(_)
%r{
^
t\.(?<type>\S+) \s*
[:'"](?<name>[^"\s]+)[,"]? \s*
(:(?<name>[a-z_]+)|"(?<name>[^"]+)"|'(?<name>[^']+)') \s*
,? \s*
(?<options>.*)
$
Expand Down
8 changes: 8 additions & 0 deletions spec/dumper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ def after(env)
Then { expect(dump use_middleware: false).to match(/\\"substring\\"\(\(random/) }
end

context "column with a whitespace", postgresql: :only do
before(:each) do
migration.execute %Q{ALTER TABLE "things" ADD "whitespaced column" integer}
end

Then { expect(dump use_middleware: false).to include('t.integer "whitespaced column"') }
end

context TestDumper::Middleware::Dumper::Initial do
Then { expect(dump).to match(/Schema([\[\].0-9]+)?[.]define.*do\s+#{middleware}/) }
end
Expand Down
Loading