lib/padrino-gen/padrino-tasks/mongoid.rb in padrino-gen-0.10.6.e vs lib/padrino-gen/padrino-tasks/mongoid.rb in padrino-gen-0.10.6
- old
+ new
@@ -7,10 +7,10 @@
end
# Helper to retrieve a list of models.
def get_mongoid_models
documents = []
- Dir['{app,}/models/*.rb'].sort.each do |file|
+ Dir['{app,.}/models/*.rb'].sort.each do |file|
model_path = file[0..-4].split('/')[2..-1]
begin
klass = model_path.map(&:classify).join('::').constantize
if klass.ancestors.include?(Mongoid::Document) && !klass.embedded