forked from travis-ci/travis-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathengine.rb
More file actions
21 lines (20 loc) · 683 Bytes
/
Copy pathengine.rb
File metadata and controls
21 lines (20 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'travis'
require 'rails/engine'
module Travis
class Engine < Rails::Engine
initializer 'add migrations path' do |app|
# need to insert to both Rails.app.paths and Migrator.migration_paths
# because Rails' stupid rake tasks copy them over before loading the
# engines *unless* multiple rake db tasks are combined (as in rake
# db:create db:migrate). Happens in Rails <= 3.2.2
paths = [
Rails.application.paths['db/migrate'],
ActiveRecord::Migrator.migrations_paths
]
paths.each do |paths|
path = root.join('db/migrate').to_s
paths << path unless paths.include?(path)
end
end
end
end