Module: ActiveModel::Naming

Defined in:
lib/engine_model.rb

Instance Method Summary collapse

Instance Method Details

#load_from_engine(engine) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/engine_model.rb', line 16

def load_from_engine(engine)
  file = File.join engine::Engine.root, "app", "models", model_name.underscore
  begin
    require file
  rescue LoadError
    raise EngineModel::MissingRoot, "The engine does not have a #{model_name}."
  end

end