Skip to content

Instantly share code, notes, and snippets.

@danfinnie
Created August 28, 2013 22:34
Show Gist options
  • Save danfinnie/6372242 to your computer and use it in GitHub Desktop.
Save danfinnie/6372242 to your computer and use it in GitHub Desktop.
Converting an existing Rails project to raise Bullet errors in test.
---
Gemfile | 2 +-
Gemfile.lock | 14 ++++++++++----
config/environments/test.rb | 5 +++++
4 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/Gemfile b/Gemfile
index 9a4481a..1a6982f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -54,6 +54,7 @@ group :development, :test do
+ gem 'bullet', github: 'danfinnie/bullet'
end
group :test do
@@ -74,7 +75,6 @@ end
group :development do
- gem 'bullet'
diff --git a/Gemfile.lock b/Gemfile.lock
index f18cef8..438ef28 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -6,6 +6,14 @@ GIT
GIT
+ remote: git://github.com/danfinnie/bullet.git
+ revision: 1f3d7ca6bc0b5b0eecc2324e485bfb83fc355d52
+ specs:
+ bullet (4.6.0)
+ activesupport
+ uniform_notifier
+
+GIT
remote: git://github.com/milgner/compass-rails.git
revision: c86e7fd9c2605c80816a2f64a3fb8b7c3a09e494
branch: rails4
@@ -96,8 +104,6 @@ GEM
- bullet (4.6.0)
- uniform_notifier
@@ -438,7 +444,7 @@ GEM
- uniform_notifier (1.2.0)
+ uniform_notifier (1.3.0)
@@ -465,7 +471,7 @@ DEPENDENCIES
- bullet
+ bullet!
diff --git a/app/models/sale.rb b/app/models/sale.rb
index dff45f2..7a900a0 100644
--- a/app/models/sale.rb
+++ b/app/models/sale.rb
@@ -105,7 +105,7 @@ class Sale < ActiveRecord::Base
- scope :eager, -> { includes(:next_step, :location, :client_liaison, :technologies, :owner) }
+ scope :eager, -> { includes(:next_step) }
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 553b3de..d8719e6 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -36,6 +36,11 @@ Clients::Application.configure do
+
+ config.after_initialize do
+ Bullet.enable = true
+ Bullet.raise = true
+ end
end
--
1.8.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment