Patches: Browse | Submit New | Admin

[#21653] Better check for development mode

Date:
2008-08-24 04:23
Priority:
3
Submitted By:
Victor Costan (costan)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Better check for development mode

Detailed description
Our project has multiple development environments (one per developer, for different database and tunnel configurations).
Using the default code (in facebooker 0.9.5), only the developer using "development" sees nice errors. Everyone
else gets Facebook's complaints about 500s. That's a PITA for debugging.

The patch below (probably easier to apply in an editor than via a command) should work as long as people's production
environments start with "prod". I think this is a safe assumption to make, and can potentially improve the
life of many devs.

Thanks for the awesome work (plugin+book)!!



Index: /Users/costan/Documents/workspace/sloanies/vendor/plugins/facebooker/lib/facebooker/rails/facebook_pretty_errors.
rb
===================================================================
--- /Users/costan/Documents/workspace/sloanies/vendor/plugins/facebooker/lib/facebooker/rails/facebook_pretty_errors.rb	
(revision 357)
+++ /Users/costan/Documents/workspace/sloanies/vendor/plugins/facebooker/lib/facebooker/rails/facebook_pretty_errors.rb	
(working copy)
@@ -1,4 +1,4 @@
-if  RAILS_ENV=="development"
+unless RAILS_ENV =~ /prod.*/
   class ActionController::Base
     def rescues_path_with_facebooker(template_name)
       t="#{RAILS_ROOT}/vendor/plugins/facebooker/templates/#{template_name}.erb"

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item