Skip to content

Instantly share code, notes, and snippets.

@haines
haines / validates_exclusion_of_nil_with_empty_array_test.rb
Created January 8, 2021 11:51
Empty arrays don't pass validate exclusion of nil in Rails 6.1
# frozen_string_literal: true
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "rails", ARGV.first
gem "pg"
end
@haines
haines / .rubocop.yml
Last active October 11, 2022 17:13
RuboCop Rails/HttpStatus bug
AllCops:
NewCops: enable
RSpec:
Patterns:
- .+

Keybase proof

I hereby claim:

  • I am haines on github.
  • I am haines (https://keybase.io/haines) on keybase.
  • I have a public key ASAdi0CeWfiA92epwPus5CCkSMOdB3lWreT0ET7pzg3ywQo

To claim this, I am signing this object:

@haines
haines / add-context-with-testing.clj
Created February 16, 2017 11:29
Failing with style - improving Clojure test summaries on CircleCI
(deftest basic-arithmetic
(testing "addition"
(testing "with positive integers"
(is (= 3 (+ 1 2))))))
@haines
haines / bug.rb
Created September 3, 2013 09:02
has_one through self join on STI model
gem 'activerecord', '4.0.0'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# This connection will do for database-independent bug reports.
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Schema.define do
@haines
haines / bundle env
Created July 31, 2013 22:22
bundle env
Bundler 1.3.5
Ruby 2.0.0 (2013-06-27 patchlevel 247) [x64-mingw32]
Rubygems 2.0.6
GEM_HOME
Gemfile
source "https://rubygems.org"
gem "ruddy", "~> 0.3"
@haines
haines / oops.rb
Created October 12, 2012 15:15
Modules with private behaviour are bad
module M
def x
y
end
private
def y
"I'm on a module!"
end
@haines
haines / Gemfile.lock
Created December 20, 2011 10:46
Gemfile.lock for testing formtastic master
PATH
remote: .
specs:
formtastic (2.0.1)
actionpack (~> 3.0)
GEM
remote: http://rubygems.org/
specs:
BlueCloth (1.0.1)