View multi_shard_test.rb
require "active_record"
require "minitest/autorun"
ENV["RAILS_ENV"] = "development"
ActiveRecord::Base.configurations = {
"development" => { "adapter" => "sqlite3", "database" => "fake.db" },
"shard1" => { "adapter" => "sqlite3", "database" => "shard1.db" },
"shard2" => { "adapter" => "sqlite3", "database" => "shard2.db" }
}
View vitess.rb
class Vitess < Formula
desc "Vitess is a database clustering system for horizontal scaling of MySQL."
homepage "http://vitess.io"
url "https://github.com/arthurnn/vitess.git",
:branch => "arthurnn/easier_build",
:revision => "f73a77ebe144e022db27c6eb9df92dc6b60a52ae"
head "https://github.com/arthurnn/vitess.git",
:shallow => false
version "2.1.1.f73a77"
View conn_handler_swap_test.rb
require "active_record"
require "minitest/autorun"
class Person < ActiveRecord::Base
establish_connection adapter: "sqlite3", database: "foobar.db"
end
class ConnHandlerSwapTest < Minitest::Test
def setup
@readonly = ActiveRecord::ConnectionAdapters::ConnectionHandler.new
View test_encrypted_gem.rb
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem 'bcrypt'
gem "activerecord", "~> 5.0.0"
gem 'sqlite3'
gem 'attr_encrypted', github: 'attr-encrypted/attr_encrypted', require: false
end
View encrypt_test.rb
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "activerecord", "~> 5.0.0"
gem 'sqlite3'
gem 'attr_encrypted', '~> 3.0', require: false
end
require 'active_record'
View example_test.rb
require 'minitest/autorun'
require 'active_record'
ActiveRecord::Base.logger = Logger.new(STDOUT)
conn = { adapter: 'sqlite3', database: ':memory:' }
ActiveRecord::Base.establish_connection(conn)
class User < ActiveRecord::Base
connection.create_table :users, force: true do |t|
t.string :username
View test.rb
require 'active_support/all'
module SetupAndTeardown
extend ActiveSupport::Concern
included do
class_attribute :callbacks
self.callbacks = []
end
View gsoc_final.md
View rails_admin_error.log
Completed 500 Internal Server Error in 193ms (ActiveRecord: 3.7ms)
I18n::ArgumentError - Object must be a Date, DateTime or Time object. "" given.:
i18n (0.7.0) lib/i18n/backend/base.rb:53:in `localize'
i18n (0.7.0) lib/i18n.rb:247:in `localize'
rails_admin (0.8.1) lib/rails_admin/config/fields/types/datetime.rb:65:in `block in <class:Datetime>'
rails_admin (0.8.1) lib/rails_admin/config/configurable.rb:66:in `block in register_instance_option'
rails_admin (0.8.1) lib/rails_admin/config/fields/base.rb:113:in `block in <class:Base>'
rails_admin (0.8.1) lib/rails_admin/config/configurable.rb:66:in `block in register_instance_option'
rails_admin (0.8.1) lib/rails_admin/config/proxyable/proxy.rb:27:in `method_missing'
View minitest_assert.rb
require "rubocop"
module RuboCop
module Cop
module Lint
# This cop checks bad use of the Minitest `assert` method
#
# `assert` method's second argument is the error message when the
# first argument evals to false.
#