Sha256: c302ff987f365cee3479f32eaca598358f872d8c96cf9f41e1d68e303adc12af

Contents?: true

Size: 761 Bytes

Versions: 2

Compression:

Stored size: 761 Bytes

Contents

module Padrino
  module Generators
    module Components
      module Orms
        
        module SequelGen

          SEQUEL = (<<-SEQUEL).gsub(/^ {10}/, '')
          module SequelInitializer
            def self.registered(app)
              Sequel::Model.plugin(:schema)
              app.configure(:development) { Sequel.connect('your_dev_db_here') }
              app.configure(:production)  { Sequel.connect('your_production_db_here') }
              app.configure(:test)        { Sequel.connect('your_test_db_here') }
            end
          end
          SEQUEL

          def setup_orm
            require_dependencies 'sequel'
            create_file("config/initializers/sequel.rb", SEQUEL)
          end
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
padrino-gen-0.1.1 lib/generators/components/orms/sequel_gen.rb
padrino-gen-0.1.0 lib/generators/components/orms/sequel_gen.rb