Sha256: 8f5de94c188daee571ab5acfede881cbaee3d9001918f40042e8d7e99eb7a6ed

Contents?: true

Size: 985 Bytes

Versions: 3

Compression:

Stored size: 985 Bytes

Contents

module TestApp

  class Application < Rails::Application
    config.active_support.deprecation = :log
  end

end

TestApp::Application.initialize!

TestApp::Application.routes.draw do

  root :to => "main#index"

  match "/questions" => "static#faq", :as => "faq"

  resources :activities

end

module SitemapTestSetup

  def create_db
    # Database
    ActiveRecord::Schema.define(:version => 1) do
      create_table :activities do |t|
        t.string :name
        t.text :contents
        t.string :location
        t.boolean :published, :default => true
        t.timestamps
      end
    end
    1.upto(8) do |i|
      options = {
        :name => "Coding #{i}",
        :contents => "Lorem ipsum dolor sit",
        :location => "someplace-#{i}",
        :published => (i < 6)
      }
      Activity.create!(options)
    end
  end

  def drop_db
    ActiveRecord::Base.connection.tables.each do |table|
      ActiveRecord::Base.connection.drop_table(table)
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sitemap-0.2 test/setup.rb
sitemap-0.2b2 test/setup.rb
sitemap-0.2b test/setup.rb