I hereby claim:
- I am rsl on github.
- I am russell_norris (https://keybase.io/russell_norris) on keybase.
- I have a public key ASDgNQUBm7StrbnoS6F1ktuBH7a-WNKukfZ5d6sSB5uCTQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 |
# Snip snip snip | |
devise_for :users, skip: [:registrations, :saml_authenticatable], controllers: {sessions: 'devise_sessions'} | |
# Manually add user editing but disallow registrations [above] | |
as :user do | |
get 'users/edit' => 'devise_registrations#edit', as: 'edit_registration' | |
patch 'users' => 'devise_registrations#update', as: 'registration' | |
# To avoid conflict saml_authenticatable routes are manually defined here. | |
# Also we override the controller. | |
resource :session, as: 'saml_session', only: [], controller: 'devise_saml_sessions', path: '/companies/:id/saml' do |
def self.find_by_ordered_ids(ids) | |
order_by = ['case'] | |
ids.each_with_index do |id, index| | |
order_by << "WHEN id='#{id}' THEN #{index}" | |
end | |
order_by << 'end' | |
where(id: ids).order(order_by.join(' ')) | |
end |
def create_database | |
Apartment::Database.create database_name | |
rescue Apartment::SchemaExists => err | |
raise err unless Rails.env.development? | |
end |
class Test::Unit::TestCase # Or ActiveSupport::TestCase if you are using Rails | |
# This is a debugging utility to find slow tests. | |
# Usage: rake FIND_SLOW_TESTS=true test:units | |
unless ENV["FIND_SLOW_TESTS"].blank? | |
alias_method :old_run, :run | |
def run(*args, &block) | |
start_time = Time.now | |
old_run *args, &block | |
test_time = Time.now - start_time | |
puts "\nSLOW TEST: #{self.name}, #{test_time}s" if test_time > 0.5 |
Fetching: rails-4.0.0.rc1.gem (100%) | |
ERROR: Error installing rails: | |
rails requires SlimGems version >= 1.8.11. Try 'gem update --system' to update SlimGems itself. | |
rsl@swanstation:~/dev/foo master | |
$ gem update --system | |
SlimGems is already up-to-date (1.3.9.5) |
require 'test_helper' | |
class SubscriptionNotifierTest < ActionMailer::TestCase | |
fixtures :companies | |
should_eventually "test other subscription mailer actions" | |
test 'should send cancellation email' do | |
company = companies(:no_categories) | |
email = SubscriptionNotifier.cancelled_subscription(company).deliver |
def fubar?(bar=(def fubar?; puts "nope"; end)) | |
puts "fubar!" | |
end | |
fubar? | |
fubar? |
module ActiveRecord | |
module ConnectionAdapters | |
class AbstractAdapter | |
protected | |
# Turn: | |
# User Load (6.3ms) SELECT * FROM "users" | |
# Into: | |
# User Load /app/views/_partial.erb:27 (6.3ms) in `_app_views_partial_erb` SELECT * FROM "users" |