Load all models into an Array

Posted Over 13 years ago. Visible to the public.
Dir.glob(File.join RAILS_ROOT, 'app', 'models', '*.rb').collect{ |path| path[/.+\/(.+).rb/,1] }.collect(&:camelize).collect(&:constantize)
Arne Hartherz
Last edit
About 13 years ago
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2010-08-25 14:13)