Class: ModelGen::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/model_gen/application_controller.rb

Direct Known Subclasses

EntitiesController, RelationsController

Instance Method Summary collapse

Instance Method Details

#available_modelsObject



6
7
8
9
10
11
# File 'app/controllers/model_gen/application_controller.rb', line 6

def available_models
  rb_files = File.join("**", "*.rb")
  Dir.glob("#{Rails.root}/app/models" + rb_files).collect do |filename|
    filename.chomp('.rb').split("/").last.camelize
  end.flatten.reject { |m| m.starts_with?('Concerns::') || m == 'ApplicationRecord' }
end