Sha256: 184f871ce9bd7738651bf7e02ec4750f9ab56eaf44eb0e674b64a8be2e2149e4

Contents?: true

Size: 752 Bytes

Versions: 1

Compression:

Stored size: 752 Bytes

Contents

module Padrino
  module Generators
    module Components
      module Orms
        
        module DatamapperGen

          DM = (<<-DM).gsub(/^ {10}/, '')
          module DatabaseSetup
            def self.registered(app)
              app.configure(:development) { DataMapper.setup(:default, 'your_dev_db_here') }
              app.configure(:production)  { DataMapper.setup(:default, 'your_production_db_here') }
              app.configure(:test)        { DataMapper.setup(:default, 'your_test_db_here') }
            end
          end
          DM

          def setup_orm
            require_dependencies 'dm-core', 'dm-validations'
            create_file("config/database.rb", DM)
          end
        end
        
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
padrino-gen-0.1.2 lib/generators/components/orms/datamapper_gen.rb