Sha256: fd5466379b3f49c382f597de9eec9be6fd9947d52d73ca2d49df237caf76f0c3

Contents?: true

Size: 691 Bytes

Versions: 1

Compression:

Stored size: 691 Bytes

Contents

# Establish connection to the database running on memory
ActiveRecord::Base.establish_connection(
  :adapter  => "sqlite3",
  :database => ":memory:"
)

# Discard ActiveRecord's log
ActiveRecord::Base.logger = Logger.new('/dev/null')

# Define migration class
class CreateAllTables < ActiveRecord::Migration
  def change
    create_table(:users) { |t| t.string :name; t.string :password_digest }
    create_table(:administrators) { |t| t.string :name; t.string :password_digest, :null => false }
  end
end

# Run migrations
migration = CreateAllTables.new
migration.verbose = false
migration.change

# Models
class User < ActiveRecord::Base
  include MiniAuth
  
  attr_accessible :name
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mini_auth-0.2.0 spec/fake_app.rb