Skip to content

Instantly share code, notes, and snippets.

View braidn's full-sized avatar
🏰
Storming

Braden Douglass braidn

🏰
Storming
View GitHub Profile
@braidn
braidn / danny_test.rb
Last active December 27, 2015 14:49
No Clue
if =~ 'Danny String'
require "weirdness #{@obj.name} here"
else
require 'something not awesome'
class Objekt
attr_accessor :symbol
def symbol_updater(symbol, value)
symbol.to_sym = value
end
end
class ApplicationController < ActionController::Base
unless Rails.application.config.consider_all_requests_local
rescue_from ActionController::RoutingError,
ActionController::UnknownController,
::AbstractController::ActionNotFound,
ActiveRecord::RecordNotFound,
with: not_found
end
protect_from_forgery
select a.account_id, c.fed_id, e.fname, e.lname
from account a inner join customer c
on a.cust_id = c.cust_id
inner join employee e
on a.open_emp_id = e.emp_id
where c.cust_type_cd = 'B';
@braidn
braidn / Stacktrace
Last active December 29, 2015 02:49
Application
[PROJECT_ROOT]/lib/tasks/abandoned_cart_reminders.rake:5:in `block (2 levels) in <top (required)>`
[PROJECT_ROOT]/lib/tasks/abandoned_cart_reminders.rake:4:in `block in <top (required)>`
Full
[PROJECT_ROOT]/lib/tasks/abandoned_cart_reminders.rake:5:in `block (2 levels) in <top (required)>`
[PROJECT_ROOT]/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/relation/delegation.rb:6:in `each`
[PROJECT_ROOT]/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/relation/delegation.rb:6:in `each`
[PROJECT_ROOT]/lib/tasks/abandoned_cart_reminders.rake:4:in `block in <top (required)>`
class ApplicationController < ActionController::Base
include Spree::Core::ControllerHelpers::Common
protect_from_forgery
unless Rails.application.config.consider_all_requests_local
rescue_from ActiveRecord::RecordNotFound,
ActionController::RoutingError,
ActionController::UnknownController,
ActionController::UnknownAction,
ActionController::MethodNotAllowed do |exception|
<Recurly::Transaction::DeclinedError: Your transaction was declined due to insufficient funds in your account. Please use a different card or contact your bank.>
@braidn
braidn / gift_issue_toggle.rb
Last active January 1, 2016 23:59
Rspec Attempt On Gift Change
module Quarterly
class GiftIssueToggle
def initialize(issue)
@issue = issue
clear_gifts_for_plan
end
def set_current
Quarterly::Issue.find(@issue.id).update_attribute(:gift, true)
@braidn
braidn / error_output.sh
Last active January 2, 2016 09:59
Rspec Quirks
Failures:
1) Quarterly::SubscriptionPlan services #to_csv generates a csv of active subscribers with 3 columns
Failure/Error: expect{ column.count }.to eq(3)
expected: 3
got: #<Proc:0x007fd91bd41ba0@/Users/cannonball/src/quarterly/spec/models/quarterly/subscription_plan_spec.rb:123>
(compared using ==)
@braidn
braidn / backtrace.sh
Created January 23, 2014 15:35
DJ Sunset Error Output
01:17:21 worker.1 | [Worker(host:cannonball pid:53409)] Job Quarterly::SunsetContributorJob (id=10787) RUNNING
01:17:21 worker.1 | [Worker(host:cannonball pid:53409)] Job Quarterly::SunsetContributorJob (id=10787) FAILED (0 prior attempts) with ActiveRecord::RecordNotFound: Couldn't find Quarterly::SubscriptionPlan without an ID
01:17:21 worker.1 | [Worker(host:cannonball pid:53409)] Job Quarterly::SunsetContributorJob (id=10787) REMOVED permanently because of 1 consecutive failures
01:17:21 worker.1 | [Worker(host:cannonball pid:53409)] 1 jobs processed at 71.8184 j/s, 1 failed