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
## http://stackoverflow.com/questions/7145256 | |
module FactoryGirl | |
module Strategy | |
class Find | |
def association(runner) | |
runner.run | |
end | |
def result(evaluation) | |
build_class(evaluation).where(get_overrides(evaluation)).first |
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
#app/inputs/collection_check_boxes_input.rb | |
class CollectionCheckBoxesInput < SimpleForm::Inputs::CollectionCheckBoxesInput | |
def item_wrapper_class | |
"checkbox-inline" | |
end | |
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
puts "WARN: We are patching rake tasks to support postgres. You have upgraded Rails and may not need this patch any more (lib/tasks/postgres.rake)." if Rails.version > "3.2.8" | |
namespace :db do | |
desc 'kills connections to postgres db' | |
task :kill_postgres_connections => :environment do | |
env = ENV['RAILS_ENV'] | |
db_config = Rails.configuration.database_configuration[env] | |
fail(ArgumentError, "Could not find db config entry for env (#{env})") unless db_config | |
db_name = db_config['database'] |
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
def compile_asset?(path) | |
# ignores any filename that begins with '_' (e.g. sass partials) | |
# all other css/js/sass/image files are processed | |
if File.basename(path) =~ /^[^_].*\.\w+$/ | |
puts "Compiling: #{path}" | |
true | |
else | |
puts "Ignoring: #{path}" | |
false | |
end |