lib/apimaster/helpers/session.rb in apimaster-0.0.3 vs lib/apimaster/helpers/session.rb in apimaster-0.0.4

- old
+ new

@@ -21,10 +21,14 @@ @current_user ||= auth_user end def auth_user @access_token ||= params[:access_token] or header_token - (test? ? Apimaster::Models::UserMock : Apimaster::Models::User).auth @access_token + user_model.auth @access_token + end + + def user_model + @user_model ||= Apimaster::Models::User end def header_token keys = %w{HTTP_AUTHORIZATION X-HTTP_AUTHORIZATION X_HTTP_AUTHORIZATION} authorization ||= keys.inject(nil) { |auth, key| auth || request.env[key] }