lib/postspec/render.rb in postspec-0.2.1 vs lib/postspec/render.rb in postspec-0.2.2
- old
+ new
@@ -102,10 +102,10 @@
constrain arg, Array, Hash
uids = arg.is_a?(Array) ? arg.map { |uid| [uid, 0] }.to_h : arg
sql =
uids.map { |uid, id| "delete from #{uid}" + (id > 0 ? " where id > #{id}" : "") } +
uids.select { |uid|
- uid =~ /^postspec\./ ? true : !postspec.type.dot(uid).subtable?
+ uid =~ /^postspec\./ ? true : !postspec.type.dot(uid).sub_table?
}.map { |uid, id|
"alter table #{uid} alter column id restart" + (id > 0 ? " with #{id+1}" : "")
}
end