Created
March 18, 2009 18:13
-
-
Save cdb/81291 to your computer and use it in GitHub Desktop.
maybe fixes a small error in facebooker facebook_pretty_errors.rb
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 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