I hereby claim:
- I am mreinsch on github.
- I am mreinsch (https://keybase.io/mreinsch) on keybase.
- I have a public key ASBVOsqAmcvVZvk1rJpx4KPv4M0AwbFBKtG-3t1zSkNRrgo
To claim this, I am signing this object:
# encoding: UTF-8 | |
# | |
# This file is in: lib/rescue_from_defaults.rb | |
# | |
# To use it, include the RescueFromDefaults in the ApplicationController (see below for example) | |
# | |
# To test it we are using rspec and steak. See below for examples. | |
# | |
class AccessDenied < RuntimeError | |
end |
I hereby claim:
To claim this, I am signing this object:
doorkeeper_contact: |"/srv/doorkeeper/current/script/email_handler contact_emails production" | |
doorkeeper_event_signup: |"/srv/doorkeeper/current/script/email_handler signup_emails production" | |
doorkeeper_bounce: |"/srv/doorkeeper/current/script/email_handler bounced_emails production" |
module CapybaraHelperMethods | |
def wait_for_ajax | |
counter = 0 | |
while !finished_all_ajax_requests? | |
counter += 1 | |
sleep 0.2 | |
raise "AJAX request took too long." if counter >= (Capybara.default_wait_time * 5) | |
end | |
end |
module RSpecLoggerListener | |
extend self | |
def start(notification) | |
Rails.logger.info("\n\n====== Starting new test run") | |
end | |
def stop(notification) | |
Rails.logger.info("\n\n====== Test run finished") | |
end | |
def example_started(notification) |
load 'deploy' unless defined?(_cset) | |
_cset :asset_env, "RAILS_GROUPS=assets" | |
_cset :assets_prefix, "assets" | |
_cset :assets_role, [:web] | |
_cset :normalize_asset_timestamps, false | |
after 'deploy:update_code', 'deploy:assets:precompile' |
$ git branch -r --merged master | | |
awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' | | |
xargs git push origin --delete |
class Event < ActiveRecord::Base | |
include Elasticsearch::Model | |
belongs_to :group | |
after_save { IndexerJob.perform_later('update', self.class.name, self.id) } | |
after_destroy { IndexerJob.perform_later('delete', self.class.name, self.id) } | |
def in_search_index? | |
published? && group.in_search_index? |
# some helpers to make integration testing with elasticsearch easier | |
# expects Capybara | |
# modify this! | |
MODELS_WITH_ELASICSEARCH_MODEL = [Group, Event] | |
begin | |
MODELS_WITH_ELASICSEARCH_MODEL.each do |c| | |
c.__elasticsearch__.create_index! force: true | |
c.__elasticsearch__.refresh_index! |
Your system is raring to brew. |