We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8835a1 commit ecdc7ebCopy full SHA for ecdc7eb
lib/database_cleaner/active_record/truncation.rb
@@ -224,7 +224,7 @@ def database_cleaner_table_cache
224
def has_been_used?(table)
225
return has_rows?(table) unless has_sequence?(table)
226
227
- cur_val = select_value("SELECT currval('#{table}_id_seq');").to_i rescue 0
+ cur_val = select_value("SELECT last_value from #{table}_id_seq;").to_i
228
cur_val > 0
229
end
230
0 commit comments