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"
|