Module: Adva::Engine::InstanceMethods

Defined in:
lib/adva/engine.rb

Instance Method Summary collapse

Instance Method Details

#copy_migrationsObject


34
35
36
37
38
39
40
41
# File 'lib/adva/engine.rb', line 34

def copy_migrations
  Dir[root.join('db/migrate/*')].map do |source|
    target = File.expand_path(source.gsub(root.to_s, '.'))
    FileUtils.mkdir_p(File.dirname(target))
    FileUtils.cp(source, target)
    target
  end
end

#load_redirectsObject


27
28
29
30
31
32
# File 'lib/adva/engine.rb', line 27

def load_redirects
  begin
    load root.join('config/redirects.rb')
  rescue LoadError
  end
end

#require_patchesObject


23
24
25
# File 'lib/adva/engine.rb', line 23

def require_patches
  Dir[root.join('lib/patches/**/*.rb')].each { |patch| require patch }
end