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.
2 parents e9cb3c7 + a11bef8 commit 71fdc90Copy full SHA for 71fdc90
activerecord/lib/active_record/schema_dumper.rb
@@ -306,6 +306,10 @@ def format_index_parts(options)
306
end
307
308
def remove_prefix_and_suffix(table)
309
+ # This method appears at the top when profiling active_record test cases run.
310
+ # Avoid costly calculation when there are no prefix and suffix.
311
+ return table if @options[:table_name_prefix].blank? && @options[:table_name_suffix].blank?
312
+
313
prefix = Regexp.escape(@options[:table_name_prefix].to_s)
314
suffix = Regexp.escape(@options[:table_name_suffix].to_s)
315
table.sub(/\A#{prefix}(.+)#{suffix}\z/, "\\1")
0 commit comments