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
require 'mongoid/collection' | |
module Mongoid | |
class Collection | |
alias_method :_update, :update | |
def update(selector, document, options = {}) | |
document.deep_fetch("_id").each do |value| | |
if value.nil? | |
Rails.logger.error "Invalid nil _id in #{document}." |
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
development: | |
sessions: | |
default: | |
database: mydb_development | |
hosts: | |
- localhost:27017 | |
options: | |
safe: true | |
test: |
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 Mongoid | |
module Slug | |
class UniqueSlug | |
alias_method :_find_unique, :find_unique | |
# by default Mongoid::Slug returns id-1 if you try to get a slug from the model's ID | |
def find_unique attempt = nil | |
if ! attempt | |
candidate = url_builder.call(model) |
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
# Here are the settings that are common to all environments | |
common: &default_settings | |
# ============================== LICENSE KEY =============================== | |
# You must specify the license key associated with your New Relic | |
# account. This key binds your Agent's data to your account in the | |
# New Relic service. | |
license_key: '<%= ENV["NEW_RELIC_LICENSE_KEY"] %>' | |
# Agent Enabled (Rails Only) |
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 ApiNewRelicInstrumenter < Grape::Middleware::Base | |
include NewRelic::Agent::Instrumentation::ControllerInstrumentation | |
def call_with_newrelic(&block) | |
trace_options = { | |
:category => :rack, | |
:path => "#{route_path}\##{route_method}", | |
:request => request | |
} |
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
$stdout.sync = true | |
require ::File.expand_path('../config/environment', __FILE__) | |
run MyApp::Application |
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
require 'rubygems' | |
require 'bundler' | |
if ENV['DISABLE_FORWARD_PROXY'] | |
eval File.read(::File.expand_path('../my_app.ru', __FILE__)) | |
else | |
$stdout.sync = true |
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
~/source/gravity/master$ git push git@heroku.com:gravity-staging.git staging:master | |
Counting objects: 37, done. | |
Delta compression using up to 4 threads. | |
Compressing objects: 100% (19/19), done. | |
Writing objects: 100% (19/19), 2.08 KiB, done. | |
Total 19 (delta 13), reused 0 (delta 0) | |
-----> Deleting 12 files matching .slugignore patterns. | |
-----> Ruby/Rails app detected | |
-----> Using Ruby version: ruby-1.9.3 | |
-----> Installing dependencies using Bundler version 1.3.0.pre.5 |
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
[2013-01-13 18:25:27 +0000] git push -f git@heroku.com:gravity-staging.git FETCH_HEAD:master | |
-----> Deleting 12 files matching .slugignore patterns. | |
-----> Ruby/Rails app detected | |
-----> Using Ruby version: ruby-1.9.3 | |
-----> Installing dependencies using Bundler version 1.3.0.pre.5 | |
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin | |
Updating https://github.com/dblock/garner.git | |
Updating https://github.com/dblock/devise_invitable.git | |
Updating https://github.com/indirect/haml-rails.git | |
Updating https://github.com/dblock/carrierwave-mongoid.git |
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
source "http://rubygems.org" | |
ruby '1.9.3' | |
Encoding.default_external = Encoding::UTF_8 | |
Encoding.default_internal = Encoding::UTF_8 | |
gem "rails", "~> 3.2" | |
gem "thin", "1.5.0" | |
gem "grape", "0.2.6" |