View conn_handler_swap_test.rb
require "active_record"
require "minitest/autorun"
class Person < ActiveRecord::Base
establish_connection adapter: "sqlite3", database: "foobar.db"
class ConnHandlerSwapTest < Minitest::Test
def setup
@readonly =
View test_encrypted_gem.rb
require "bundler/inline"
gemfile(true) do
source ""
gem 'bcrypt'
gem "activerecord", "~> 5.0.0"
gem 'sqlite3'
gem 'attr_encrypted', github: 'attr-encrypted/attr_encrypted', require: false
View encrypt_test.rb
require "bundler/inline"
gemfile(true) do
source ""
gem "activerecord", "~> 5.0.0"
gem 'sqlite3'
gem 'attr_encrypted', '~> 3.0', require: false
require 'active_record'
View example_test.rb
require 'minitest/autorun'
require 'active_record'
ActiveRecord::Base.logger =
conn = { adapter: 'sqlite3', database: ':memory:' }
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 = []
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.
View initializer_instrumentation.rb
# Backport patch made on Rails 4.1 , to add instrumentation around the
# initializer load code. see
# Remove this patch once we are on Rails 4.1+
Rails::Engine.class_eval do
if method_defined? :load_config_initializer
warn "[DEPRECATION] load_config_initializer patch can now be removed."
def load_config_initializer(initializer)
ActiveSupport::Notifications.instrument('load_config_initializer.railties', initializer: initializer) do
View console.rb
[arthurnn@snowball ~]$ irb
irb(main):001:0> class Foo
irb(main):002:1> FOO = "foo"
irb(main):003:1> end
=> "foo"
irb(main):005:0> Foo.class_eval { BAR = "bar" }
=> "bar"
irb(main):006:0> BAR
=> "bar"
irb(main):007:0> FOO