Skip to content

Commit

Permalink
stree
Browse files Browse the repository at this point in the history
  • Loading branch information
waymondo committed Jan 11, 2024
1 parent 78370a0 commit 1dc1d52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/hoardable/schema_dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ def tables(stream)
end

private def dump_inherited_tables(stream)
sorted_tables =
@connection.tables.filter { |table| @connection.inherited_table?(table) }.sort
sorted_tables = @connection.tables.filter { |table| @connection.inherited_table?(table) }.sort
sorted_tables.each do |table_name|
table(table_name, stream)
foreign_keys(table_name, stream)
Expand Down
4 changes: 3 additions & 1 deletion test/test_schema_dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ class TestSchemaDumper < ActiveSupport::TestCase
output = dump_table_schema("post_versions", "posts")
assert posts_index = output.index(/create_table "posts"/)
assert post_versions_index = output.index(/create_table "post_versions"/)
assert post_versions_trigger_index = output.index(/create_trigger :post_versions_prevent_update/)
assert(
post_versions_trigger_index = output.index(/create_trigger :post_versions_prevent_update/)
)
assert post_versions_index > posts_index
assert post_versions_trigger_index > post_versions_index
end
Expand Down

0 comments on commit 1dc1d52

Please sign in to comment.