Thanks to this week's contributors to thoughtbot projects.
Test your Ruby gem against different versions of its dependencies.
1.9.3-p392 |
class Customer | |
def initialize(attrs = {}) | |
@id = attrs[:id] | |
@country = attrs[:country] | |
end | |
def tax_code | |
TaxCodes[@country].call(@id) | |
rescue | |
raise "Tax codes for #{@country} not supported" |
Thanks to this week's contributors to thoughtbot projects.
Test your Ruby gem against different versions of its dependencies.
A guide for getting things done.
Set up your laptop with this script and these dotfiles.
module DelayedJob | |
module Matchers | |
def enqueue_delayed_job(handler) | |
DelayedJobMatcher.new handler | |
end | |
class DelayedJobMatcher | |
def initialize(handler) | |
@handler = handler | |
@attributes = {} |
class BidOfferedJob < Struct.new(:bid_id) | |
PRIORITY = 1 | |
def self.enqueue(bid) | |
Delayed::Job.enqueue new(bid.id), priority: PRIORITY | |
end | |
def perform | |
Mailer.bid_offered(owner, bid).deliver | |
Activity.create activity_type: 'bid_offered', subject: bid, user: aide |
class AddIndexToUsersSubscriptionToken < ActiveRecord::Migration | |
def self.up | |
change_column_null :users, :subscription_token, false | |
if ENV['NO_DDL_TRANSACTION'] | |
execute <<-eosql | |
CREATE UNIQUE INDEX CONCURRENTLY index_users_on_subscription_token | |
ON users (subscription_token) | |
eosql | |
else |
%ul | |
- activities.each do |activity| | |
%li | |
.activity{ data: { role: activity.activity_type } } | |
= render_activity activity |
curl -o latest.dump `heroku pgbackups:url --app project-production` | |
pg_restore --verbose --clean --no-acl --no-owner -d project_development latest.dump | |
rm latest.dump |