Skip to content

Instantly share code, notes, and snippets.

@cdb
Created March 18, 2009 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdb/81291 to your computer and use it in GitHub Desktop.
Save cdb/81291 to your computer and use it in GitHub Desktop.
maybe fixes a small error in facebooker facebook_pretty_errors.rb
class ActionController::Base
def rescues_path_with_facebooker(template_name)
if pretty_facebook_errors?
t = "#{RAILS_ROOT}/vendor/plugins/facebooker/templates/#{template_name}.erb"
File.exist?(t) ? t : rescues_path_without_facebooker(template_name)
else
rescues_path_without_facebooker(template_name)
end
end
alias_method_chain :rescues_path, :facebooker
def response_code_for_rescue_with_facebooker(exception)
pretty_facebook_errors? ? 200 : response_code_for_rescue_without_facebooker(exception)
end
alias_method_chain :response_code_for_rescue, :facebooker
def pretty_facebook_errors?
Facebooker.facebooker_config['pretty_errors'] ||
(Facebooker.facebooker_config['pretty_errors'].nil? && RAILS_ENV=="development")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment