Sha256: a00b7bc38a75f3cf9f24aec5ff7fac6ee27da54bd4adeb970210737fecefb7bf

Contents?: true

Size: 960 Bytes

Versions: 2

Compression:

Stored size: 960 Bytes

Contents

gem 'activerecord', '~> 3.2'
gem 'sqlite3'

template 'activerecord/models.rb', 'models.rb'

require_models_code = <<-CODE
  # Enable code reloading for models
  require_dependency 'models'
CODE
inject_into_file 'application_controller.rb', "\n#{require_models_code}", :after => /class ApplicationController < ActionController::Base/

application <<-CODE
  # We need to override the configuration method here, otherwise Rails will
  # try to load the yaml configuration file at config/database.yml
  def config.database_configuration
    {
      'development' =>
        {
          'adapter'  => 'sqlite3',
          'database' => 'db.sqlite3',
          'pool'     => 5,
          'timeout'  => 5000
        }
    }
  end
CODE

inject_into_file 'boot.rb', "\nrequire \"active_record/railtie\"", :after => /require ['"]action_controller\/railtie['"]/

template 'activerecord/migrate', 'migrate'
chmod 'migrate', 0755

append_to_file '.gitignore', 'db.sqlite3'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tiny-rails-0.1.1 addons/activerecord.rb
tiny-rails-0.1.0 addons/activerecord.rb