2016-10-06 14:14:57 -04:00
|
|
|
if Rails.env.test?
|
|
|
|
require 'active_record/migration'
|
|
|
|
|
|
|
|
module ActiveRecord
|
|
|
|
class Migrator
|
|
|
|
class << self
|
|
|
|
alias_method :migrations_unmemoized, :migrations
|
|
|
|
|
|
|
|
# This method is called a large number of times per rspec example, and
|
|
|
|
# it reads + parses `db/migrate/*` each time. Memoizing it can save 0.5
|
|
|
|
# seconds per spec.
|
|
|
|
def migrations(paths)
|
2017-05-29 06:27:13 -04:00
|
|
|
(@migrations ||= migrations_unmemoized(paths)).dup
|
2016-10-06 14:14:57 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|