Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: b3b7b30357
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (21 sloc) 0.638 kB
require 'application_controller'
module AttachScreenshotPlugin
module ApplicationControllerPatch
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
base.class_eval do
unloadable
alias_method_chain :find_current_user, :screenshot
end
end
module InstanceMethods
def find_current_user_with_screenshot
if params[:controller] == "attach_screenshot" && request.post? && params[:key].present?
User.find_by_rss_key(params[:key])
else
find_current_user_without_screenshot
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.