Class: ModelGen::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- ModelGen::ApplicationController
show all
- Defined in:
- app/controllers/model_gen/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
#available_models ⇒ Object
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
|