Skip to content

Commit 19cbfa2

Browse files
authored
MONGOID-5691 Ensure that all Mongoid config options are mentioned in the documentation (#5748)
* MONGOID-5691 refresh configuration docs from latest mongoid.yml template * no need to explicitly call out earlier versions * clearer delineation between general/specific comments
1 parent 53496de commit 19cbfa2

File tree

3 files changed

+192
-150
lines changed

3 files changed

+192
-150
lines changed

Rakefile

+14
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ namespace :eg do
6767
end
6868
end
6969

70+
namespace :generate do
71+
desc 'Generates a mongoid.yml from the template'
72+
task :config do
73+
require 'mongoid'
74+
require 'erb'
75+
76+
template_path = 'lib/rails/generators/mongoid/config/templates/mongoid.yml'
77+
database_name = ENV['DATABASE_NAME'] || 'my_db'
78+
79+
config = ERB.new(File.read(template_path), trim_mode: '-').result(binding)
80+
File.write('mongoid.yml', config)
81+
end
82+
end
83+
7084
CLASSIFIERS = [
7185
[%r,^mongoid/attribute,, :attributes],
7286
[%r,^mongoid/association/[or],, :associations_referenced],

0 commit comments

Comments
 (0)