Skip to content

Instantly share code, notes, and snippets.

View kaikuchn's full-sized avatar

Kai Kuchenbecker kaikuchn

View GitHub Profile
@kaikuchn
kaikuchn / arm.rb
Last active August 29, 2015 14:15
Single Association Replace Behavior
class Arm < ActiveRecord::Base
belongs_to :bandit, inverse_of: :arm
# instead of validating this here, you could also add a uniqueness
# constraint through a migration. Behavior would be similiar.
validates :bandit, uniqueness: true
end
@kaikuchn
kaikuchn / doctor_output
Created August 9, 2014 14:51
Output of rbenv doctor script
root@vmd3328:/var/www/bochumbbdevgroup/current# curl -s https://gist.githubusercontent.com/mislav/4728286/raw/rbenv-doctor.sh | bash -x 2>&1
+ rbenv --version
rbenv 0.4.0-98-g13a474c
+ rbenv versions
2.1.0
* 2.1.2 (set by /var/www/bochumbbdevgroup/current/.ruby-version)
+ rbenv global
2.1.2
+ env
+ grep -E 'PATH|RUBY|BUNDLE|RBENV'