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
require 'benchmark' | |
def get_lambda | |
lambda { } | |
end | |
def my_method; end | |
Benchmark.bmbm do |x| | |
x.report { 1_000_000.times { method(:my_method) } } |
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 ApplicationController < ActionController::Base | |
protect_from_forgery | |
rescue_from CanCan::AccessDenied do |exception| | |
flash[:alert] = exception.message | |
redirect_to root_url | |
end | |
protected |