Module: Adva::Engine::Initializations
- Includes:
- SlicedModels
- Defined in:
- lib/adva/engine.rb
Instance Method Summary collapse
Methods included from SlicedModels
Instance Method Details
#copy_migrations ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/adva/engine.rb', line 54 def copy_migrations Dir[root.join('db/migrate/*')].map do |source| target = File.(source.gsub(root.to_s, '.')) FileUtils.mkdir_p(File.dirname(target)) FileUtils.cp(source, target) target end end |
#engine_name ⇒ Object
38 39 40 41 |
# File 'lib/adva/engine.rb', line 38 def engine_name name = is_a?(Class) ? self.name : self.class.name # ughugh. name.underscore.split('/').last end |
#load_redirects ⇒ Object
47 48 49 50 51 52 |
# File 'lib/adva/engine.rb', line 47 def load_redirects begin load root.join('config/redirects.rb') rescue LoadError end end |
#require_patches ⇒ Object
43 44 45 |
# File 'lib/adva/engine.rb', line 43 def require_patches Dir[root.join('lib/patches/**/*.rb')].each { |patch| require patch } end |