Skip to content

Instantly share code, notes, and snippets.

View ColinW520's full-sized avatar
🏠
Working from home

Colin Hagan ColinW520

🏠
Working from home
  • Procare Software
  • Fort Collins, CO
View GitHub Profile
@MarceloCajueiro
MarceloCajueiro / read_only_middleware.rb
Created February 21, 2016 12:55
Use database follower with Sidekiq
require 'delegate'
module SidekiqExt
# Use read-only database if :db option is :read_only,
# otherwise use the default connection.
#
# Example:
#
# class MyWorker
# include Sidekiq::Worker
@ka8725
ka8725 / states_matcher.rb
Created December 13, 2013 12:23
Custom matcher for Rspec to test state_machine status flow
# This custom matcher can be used to test state machine
#
# Examples
#
# it { should have_event(:status, :event_name, [:state1, :state2] => [:state3, :state4]) }
# it { should have_event(:status, :event_name, {
# :state1 => :state3,
# :state1 => :state4,
# :state3 => :state3,
# :state2 => :state4