This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveRecord::Reflection::AssociationReflection | |
class AmbiguousAssociationClassError < Exception | |
def initialize results | |
super "Could not guess association, please specify using class_name. Likely options: #{results.join(', ')}" | |
end | |
end | |
def klass | |
super | |
rescue NameError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is used by Rack-based servers to start the application. | |
$stdout.sync = true | |
require 'unicorn/worker_killer' | |
## | |
## Maximum Requests | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
printf '\npost-checkout hook\n\n' | |
if [[ $3 == 1 ]]; then | |
echo "Creating `git name-rev --name-only $2`" | |
createdb "ticketbud_`git name-rev --name-only $2`_development" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person < ActiveRecord::Base | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// multi-ticket icon | |
.fa-tickets { | |
&:after, &:before { | |
content: "\f145"; | |
} | |
&:after { | |
margin-left: -12px; | |
opacity: 0.7; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AccessibleBlock | |
extend ActiveSupport::Concern | |
module ClassMethods | |
@accessible_block = false | |
def key(*arguments, &block) | |
super | |
attr_accessible arguments[0] if @accessible_block | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
extend Filterable | |
after_update -> { user.clear_cache! } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def questionable | |
questionable? ? to_s : "#{to_s}?" | |
end | |
def questionable! | |
replace questionable | |
end | |
def questionable? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Easily add id and class attributes to HAML elements | |
# | |
# %li{ account.element.to_hash } -> | |
# <li class='account' id='account-7'> | |
# | |
# %span{ account.element.button.to_hash } -> | |
# <span class='account-button' id='account-7-button'> | |
# | |
# %span{ :class => account.element.save.button.class } -> | |
# <span class='account-save-button'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# constituent_importer.rb | |
# | |
# When the customer uploads an Excel file, | |
# we generate a unique ID for the file and | |
# store it on our AWS/S3 jobs bucket. | |
# | |
# Then we create a job with that unique ID, | |
# and our background workers execute the job as follows | |
class ConstituentImporter < Struct.new(:job_object_id) |
OlderNewer