Sha256: ef97afbe01795b1ebb09d1952a56fb872a2c8d42bb357c177695620bcf17de8b

Contents?: true

Size: 629 Bytes

Versions: 216

Compression:

Stored size: 629 Bytes

Contents

# encoding: utf-8
require 'rails/generators/mongoid_generator'

module Mongoid
  module Generators
    class ConfigGenerator < Rails::Generators::Base
      desc "Creates a Mongoid configuration file at config/mongoid.yml"

      argument :database_name, :type => :string, :optional => true

      def self.source_root
        @_mongoid_source_root ||= File.expand_path("../templates", __FILE__)
      end

      def app_name
        Rails::Application.subclasses.first.parent.to_s.underscore
      end

      def create_config_file
        template 'mongoid.yml', File.join('config', "mongoid.yml")
      end

    end
  end
end

Version data entries

216 entries across 124 versions & 7 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/config/config_generator.rb
mongoid-2.8.1 lib/rails/generators/mongoid/config/config_generator.rb
mongoid-2.8.0 lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.9/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.7/lib/rails/generators/mongoid/config/config_generator.rb
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.10/lib/rails/generators/mongoid/config/config_generator.rb