Sha256: 2f8ab7fd4f0c9cb319ae1bd929f929ec8c2160c38789de47299b9d3f18765ef1

Contents?: true

Size: 412 Bytes

Versions: 9

Compression:

Stored size: 412 Bytes

Contents

class ApplicationController < ActionController::Base
  protect_from_forgery
  
  rescue_from StandardError do |e|
    pp e.backtrace
    raise e
  end

  def current_user
  	# for testing purposes we just create a user and store it in the db
    @current_user ||= begin
    	u = User.find_by_id(session[:user_id]) || User.create(:first_name =>"Michael")
    	session[:user_id] = u.id
    	u
    end
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
will_filter-5.1.4 test/dummy/app/controllers/application_controller.rb
will_filter-5.1.3 test/dummy/app/controllers/application_controller.rb
will_filter-5.1.2 test/dummy/app/controllers/application_controller.rb
will_filter-5.1.1 test/dummy/app/controllers/application_controller.rb
will_filter-5.1.0 test/dummy/app/controllers/application_controller.rb
will_filter-3.1.11 test/dummy/app/controllers/application_controller.rb
will_filter-3.1.10 test/dummy/app/controllers/application_controller.rb
will_filter-3.1.9 test/dummy/app/controllers/application_controller.rb
will_filter-3.1.8 test/dummy/app/controllers/application_controller.rb