Add option to skip tabels when using DbHelper.remap.

This commit is contained in:
Guo Xiang Tan
2018-11-08 12:28:50 +08:00
parent 09dc922b3b
commit 9737938a4a
2 changed files with 12 additions and 1 deletions

View File

@ -32,5 +32,13 @@ RSpec.describe DbHelper do
expect(badge_attributes.except("query"))
.to eq(badge.attributes.except("query"))
end
it 'allows tables to be excluded from scanning' do
post = Fabricate(:post, cooked: "test")
DbHelper.remap("test", "something else", exclude_tables: %w{posts})
expect(post.reload.cooked).to eq('test')
end
end
end