Sha256: 4b434074f5cadf03253574c12280658901964483434fcc2d2a8fc959dc1609aa

Contents?: true

Size: 357 Bytes

Versions: 22

Compression:

Stored size: 357 Bytes

Contents

class SessionsController < ApplicationController
  [:user, :guest, :admin].each do |role|
    class_eval %{
      def login_#{role}
        session[:current_#{role}] = User.find params[:id]
        render :nothing => true
      end

      def logout_#{role}
        session[:current_#{role}] = nil
        render :nothing => true
      end
    }
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
cantango-0.9.4.7 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.9.4.6 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.9.4.5 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.9.4.3 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.9.4.2 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.9.4.1 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.9.4 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.9.3.2 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.9.5 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.9.4 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.9.3 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.9.2 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.9.1 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.9 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.8.1 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.8 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.7 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.6.2 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.6.1 spec/dummy/app/controllers/sessions_controller.rb
cantango-0.8.6 spec/dummy/app/controllers/sessions_controller.rb