repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/services/github_authenticator_spec.rb | spec/services/github_authenticator_spec.rb | describe GithubAuthenticator do
let(:uid_mapped_field) { 'id' }
let(:authenticated_user_data) do
{
email: 'user@gmail.com',
id: '789789789789'
}
end
include_context 'stubbed github requests'
it_behaves_like 'a authenticator'
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/services/google_authenticator_spec.rb | spec/services/google_authenticator_spec.rb | describe GoogleAuthenticator do
let(:uid_mapped_field) { 'sub' }
let(:authenticated_user_data) do
{
email: 'user@gmail.com',
sub: '789789789789'
}
end
include_context 'stubbed google requests'
it_behaves_like 'a authenticator'
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/services/edx_authenticator_spec.rb | spec/services/edx_authenticator_spec.rb | describe EdxAuthenticator do
let(:uid_mapped_field) { 'username' }
let(:authenticated_user_data) do
{
email: 'user@edxdomain.org',
username: 'user'
}
end
include_context 'stubbed edx requests'
it_behaves_like 'a authenticator'
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/services/facebook_authenticator_spec.rb | spec/services/facebook_authenticator_spec.rb | describe FacebookAuthenticator do
let(:uid_mapped_field) { 'id' }
let(:authenticated_user_data) do
{
email: 'user@facebook.com',
id: '123123123123'
}
end
include_context 'stubbed facebook requests'
it_behaves_like 'a authenticator'
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/support/factory_girl.rb | spec/support/factory_girl.rb | RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/support/shared_examples/oauth2_shared_requests.rb | spec/support/shared_examples/oauth2_shared_requests.rb | shared_context 'oauth2 shared contexts' do
let(:params) { { grant_type: grant_type, auth_code: 'authcode' } }
let(:access_token) { 'access_token' }
let(:email) { login.identification }
context 'when a login with for the service account exists' do
it 'connects the login to the service account' do
subj... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/support/shared_examples/oauth2_edx_shared_requests.rb | spec/support/shared_examples/oauth2_edx_shared_requests.rb | shared_context 'oauth2 edx shared contexts' do
let(:params) { { username: username, grant_type: grant_type, auth_code: 'authcode' } }
let(:access_token) { 'access_token' }
let(:email) { login.identification }
context 'when a login with for the service account exists' do
it 'connects the login to the servic... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/support/shared_examples/authenticator_shared_requests.rb | spec/support/shared_examples/authenticator_shared_requests.rb | shared_examples 'a authenticator' do
describe '#authenticate!' do
let(:login) { double('login') }
if described_class::PROVIDER.eql? 'edx'
subject { described_class.new(username, auth_code).authenticate! }
elsif described_class::PROVIDER.eql? 'github'
subject { described_class.new(auth_state, ... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/support/shared_contexts/stubbed_google_requests.rb | spec/support/shared_contexts/stubbed_google_requests.rb | shared_context 'stubbed google requests' do
let(:auth_code) { 'authcode' }
let(:response_with_token) { { body: '{ "access_token": "access_token" }, "token_type": "Bearer", "expires_in": 3600' } }
let(:response_with_user) { { body: JSON.generate(authenticated_user_data), headers: { 'Content-Type' => 'application... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/support/shared_contexts/force_ssl.rb | spec/support/shared_contexts/force_ssl.rb | shared_context 'with force_ssl configured' do
around do |example|
default_force_ssl = RailsApiAuth.force_ssl
RailsApiAuth.force_ssl = force_ssl
example.run
RailsApiAuth.force_ssl = default_force_ssl
end
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/support/shared_contexts/stubbed_facebook_requests.rb | spec/support/shared_contexts/stubbed_facebook_requests.rb | shared_context 'stubbed facebook requests' do
let(:auth_code) { 'authcode' }
let(:access_token) { 'CAAMvEGOZAxB8BAODGpIWO9meEXEpvigfIRs5j7LIi1Uef8xvTz4vpayfP6rxn0Om3jZAmvEojZB9HNWD44PgSSwFyD7bKsJ3EaNMKwYpZBRqjm25HfwUzF3pOVRXp9cdquT1afm7bj4mnb4WFFo7TxLcgO848FaAKZBdxwefJlPneVUSpquEh2TZAVWghndnPO9ON7QTqXhAZD... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/support/shared_contexts/stubbed_github_requests.rb | spec/support/shared_contexts/stubbed_github_requests.rb | shared_context 'stubbed github requests' do
let(:auth_code) { 'authcode' }
let(:auth_state) { 'abc123' }
let(:access_token) { 'UsQfLVVKUJmSjD6gtRk9UsrZqfpL9ajB' }
let(:response_with_gh_token) { { body: JSON.generate({ access_token: access_token, token_type: 'bearer', scope: 'user' }), headers: { 'Content-Type' ... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/support/shared_contexts/stubbed_edx_requests.rb | spec/support/shared_contexts/stubbed_edx_requests.rb | shared_context 'stubbed edx requests' do
let(:auth_code) { 'authcode' }
let(:username) { 'user' }
let(:response_with_token) { { body: '{ "access_token": "access_token" }, "token_type": "Bearer", "expires_in": 3600' } }
let(:response_with_user) { { body: JSON.generate(authenticated_user_data), headers: { 'Co... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/requests/custom_authenticated_spec.rb | spec/requests/custom_authenticated_spec.rb | describe 'a custom authenticated route' do
if Rails::VERSION::MAJOR < 5
# rubocop:disable Rails/HttpPositionalArguments
subject { get '/custom-authenticated', {}, headers }
# rubocop:enable Rails/HttpPositionalArguments
let(:headers) do
{ 'Authorization' => "Bearer #{login.oauth2_token}" }
e... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/requests/oauth2_spec.rb | spec/requests/oauth2_spec.rb | describe 'Oauth2 API' do
let!(:login) { create(:login) }
describe 'POST /token' do
let(:params) { { grant_type: 'password', username: login.identification, password: login.password } }
if Rails::VERSION::MAJOR < 5
# rubocop:disable Rails/HttpPositionalArguments
subject { post '/token', params, ... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/requests/access_once_spec.rb | spec/requests/access_once_spec.rb | describe 'an access-once route' do
if Rails::VERSION::MAJOR < 5
# rubocop:disable Rails/HttpPositionalArguments
subject { get '/access-once', {}, headers }
# rubocop:enable Rails/HttpPositionalArguments
else
subject { get '/access-once', params: {}, headers: headers }
end
let(:login) { create(:... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/requests/authenticated_spec.rb | spec/requests/authenticated_spec.rb | describe 'an authenticated route' do
if Rails::VERSION::MAJOR < 5
# rubocop:disable Rails/HttpPositionalArguments
subject { get '/authenticated', {}, headers }
# rubocop:enable Rails/HttpPositionalArguments
else
subject { get '/authenticated', params: {}, headers: headers }
end
let(:headers) { ... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/factories/accounts.rb | spec/factories/accounts.rb | FactoryGirl.define do
factory :account do
first_name { Faker::Name.first_name }
last_name { Faker::Name.last_name }
end
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/factories/logins.rb | spec/factories/logins.rb | FactoryGirl.define do
factory :login do
identification { Faker::Internet.email }
password { Faker::Lorem.word }
trait :facebook do
uid { Faker::Number.number }
password nil
provider 'facebook'
end
end
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/models/login_spec.rb | spec/models/login_spec.rb | describe Login do
it 'belongs to the configured user model' do
expect(subject).to belong_to(:account).with_foreign_key(:user_id)
end
subject { Login.new(identification: 'test@example.com', oauth2_token: 'token', single_use_oauth2_token: 'oldtoken') }
describe 'validations' do
before do
allow_any... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/app/controllers/authenticated_controller.rb | spec/dummy/app/controllers/authenticated_controller.rb | class AuthenticatedController < ApplicationController
include RailsApiAuth::Authentication
if Rails::VERSION::MAJOR < 4
before_filter :authenticate!
else
before_action :authenticate!
end
def index
if Rails::VERSION::MAJOR < 4
render text: 'zuper content', status: :ok
else
render... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/app/controllers/custom_authenticated_controller.rb | spec/dummy/app/controllers/custom_authenticated_controller.rb | class CustomAuthenticatedController < ApplicationController
include RailsApiAuth::Authentication
if Rails::VERSION::MAJOR < 4
before_filter :authenticate_with_account!
else
before_action :authenticate_with_account!
end
def index
if Rails::VERSION::MAJOR < 4
render text: 'zuper content', s... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/app/controllers/application_controller.rb | spec/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/app/controllers/access_once_controller.rb | spec/dummy/app/controllers/access_once_controller.rb | class AccessOnceController < ApplicationController
include RailsApiAuth::Authentication
if Rails::VERSION::MAJOR < 4
before_filter :consume_single_use_oauth2_token!
else
before_action :consume_single_use_oauth2_token!
end
def index
if Rails::VERSION::MAJOR < 4
render text: 'zuper content'... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/app/models/account.rb | spec/dummy/app/models/account.rb | class Account < ActiveRecord::Base
has_one :login
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/db/schema.rb | spec/dummy/db/schema.rb | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/db/migrate/20150803185817_create_accounts.rb | spec/dummy/db/migrate/20150803185817_create_accounts.rb | require_relative '../../../../db/migrate/rails_api_auth_migration'
class CreateAccounts < RailsAPIAuthMigration
def change
create_table :accounts do |t|
t.string :first_name, null: false
t.string :last_name, null: true
t.timestamps
end
end
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/application.rb | spec/dummy/config/application.rb | require File.expand_path('boot', __dir__)
require 'active_record/railtie'
require 'action_controller/railtie'
require 'sprockets/railtie'
Bundler.require(*Rails.groups)
require 'rails_api_auth'
module Dummy
class Application < Rails::Application
end
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/environment.rb | spec/dummy/config/environment.rb | # Load the Rails application.
require File.expand_path('application', __dir__)
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/routes.rb | spec/dummy/config/routes.rb | Rails.application.routes.draw do
get '/authenticated' => 'authenticated#index'
get '/custom-authenticated' => 'custom_authenticated#index'
get '/access-once' => 'access_once#index'
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/boot.rb | spec/dummy/config/boot.rb | # Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/initializers/filter_parameter_logging.rb | spec/dummy/config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Dummy::Application.config.filter_parameters += [:password]
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/initializers/session_store.rb | spec/dummy/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/initializers/wrap_parameters.rb | spec/dummy/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters f... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/initializers/inflections.rb | spec/dummy/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/initializers/cookies_serializer.rb | spec/dummy/config/initializers/cookies_serializer.rb | # Be sure to restart your server when you modify this file.
Dummy::Application.config.action_dispatch.cookies_serializer = :json
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/initializers/assets.rb | spec/dummy/config/initializers/assets.rb | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Dummy::Application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/initializers/rails_api_auth.rb | spec/dummy/config/initializers/rails_api_auth.rb | RailsApiAuth.tap do |raa|
raa.user_model_relation = :account
raa.facebook_app_id = 'app_id'
raa.facebook_app_secret = 'app_secret'
raa.facebook_redirect_uri = 'redirect_uri'
raa.google_client_id = 'google_client_id'
raa.google_client_secret = 'google_client_secret'
raa.google_redirect_uri = 'goo... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/initializers/backtrace_silencers.rb | spec/dummy/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/initializers/mime_types.rb | spec/dummy/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/initializers/secret_token.rb | spec/dummy/config/initializers/secret_token.rb | Dummy::Application.config.secret_token = 'd793b643dbf138320b2e2edef7d6ba8e'
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/environments/test.rb | spec/dummy/config/environments/test.rb | Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test sui... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/environments/development.rb | spec/dummy/config/environments/development.rb | Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web ser... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/dummy/config/environments/production.rb | spec/dummy/config/environments/production.rb | Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serv... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/spec/config/force_ssl_spec.rb | spec/config/force_ssl_spec.rb | describe RailsApiAuth do
it 'has force_ssl with default value of true' do
expect(subject.force_ssl).to eq true
end
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/lib/rails_api_auth.rb | lib/rails_api_auth.rb | require 'rails_api_auth/engine'
# The engine's main module.
module RailsApiAuth
# @!attribute [rw] user_model_relation
# Defines the `Login` model's `belongs_to` relation to the host application's
# `User` model (or `Account` or whatever the application stores user data
# in).
#
# E.g. is this is set to `... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/lib/rails_api_auth/authentication.rb | lib/rails_api_auth/authentication.rb | module RailsApiAuth
# Module that defines attributes and method for use in controllers. This
# module would typically be included in the `ApplicationController`.
module Authentication
extend ActiveSupport::Concern
# @!attribute [r] current_login
# The login that was authenticated from the Bearer to... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/lib/rails_api_auth/version.rb | lib/rails_api_auth/version.rb | module RailsApiAuth
VERSION = '0.1.0'.freeze
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/lib/rails_api_auth/engine.rb | lib/rails_api_auth/engine.rb | require 'rails_api_auth/authentication'
module RailsApiAuth
# @!visibility private
class Engine < ::Rails::Engine
engine_name 'rails_api_auth'
initializer :append_migrations do |app|
unless app.root.to_s.match root.to_s
config.paths['db/migrate'].expanded.each do |expanded_path|
... | ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
mainmatter/rails_api_auth | https://github.com/mainmatter/rails_api_auth/blob/c949cef9f207b3ac60c400eb0d5191bf110ebab8/config/routes.rb | config/routes.rb | Rails.application.routes.draw do
post 'token', to: 'oauth2#create'
post 'revoke', to: 'oauth2#destroy'
end
| ruby | MIT | c949cef9f207b3ac60c400eb0d5191bf110ebab8 | 2026-01-04T17:43:51.272302Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/decorators/equipment_model_decorator.rb | app/decorators/equipment_model_decorator.rb | # frozen_string_literal: true
class EquipmentModelDecorator < ApplicationDecorator
delegate_all
# Define presentation-specific methods here. Helpers are accessed through
# `helpers` (aka `h`). You can override attributes, for example:
#
# def created_at
# helpers.content_tag :span, class: 'time' do
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/decorators/equipment_item_decorator.rb | app/decorators/equipment_item_decorator.rb | # frozen_string_literal: true
class EquipmentItemDecorator < ApplicationDecorator
delegate_all
# Define presentation-specific methods here. Helpers are accessed through
# `helpers` (aka `h`). You can override attributes, for example:
#
# def created_at
# helpers.content_tag :span, class: 'time' do
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/decorators/category_decorator.rb | app/decorators/category_decorator.rb | # frozen_string_literal: true
class CategoryDecorator < ApplicationDecorator
delegate_all
# Define presentation-specific methods here. Helpers are accessed through
# `helpers` (aka `h`). You can override attributes, for example:
#
# def created_at
# helpers.content_tag :span, class: 'time' do
# ... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/decorators/application_decorator.rb | app/decorators/application_decorator.rb | # frozen_string_literal: true
class ApplicationDecorator < Draper::Decorator
include Draper::LazyHelpers
def make_deactivate_btn(onclick_str = nil)
if object.deleted_at
link_to 'Activate', [:activate, object], class: 'btn btn-success',
method: :put
else
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/flag_missed_job.rb | app/jobs/flag_missed_job.rb | # frozen_string_literal: true
class FlagMissedJob < ReservationJob
private
def type
'newly missed'
end
def new_missed
collection(:newly_missed)
end
def prep_collection
new_missed
end
def run
new_missed.each do |res|
log_flag res
update res
end
end
def log_flag(r... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/hourly_tasks_job.rb | app/jobs/hourly_tasks_job.rb | # frozen_string_literal: true
class HourlyTasksJob < ApplicationJob
queue_as :default
def perform
EmailNotesToAdminsJob.perform_now
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/delete_missed_reservations_job.rb | app/jobs/delete_missed_reservations_job.rb | # frozen_string_literal: true
class DeleteMissedReservationsJob < ReservationJob
private
def type
'old missed'
end
def enabled
!AppConfig.check(:res_exp_time, '').blank?
end
def run
old_missed_reservations.each do |missed_reservation|
log_deletion missed_reservation
missed_reserva... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/reservation_job.rb | app/jobs/reservation_job.rb | # frozen_string_literal: true
class ReservationJob < ActiveJob::Base
queue_as :default
UNDEFINED_MESSAGE = 'JOB NOT DEFINED'
def perform
if enabled
log_start
run
clean
log_completion
else
log_disabled
end
end
private
def type
UNDEFINED_MESSAGE
end
def ta... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/flag_overdue_job.rb | app/jobs/flag_overdue_job.rb | # frozen_string_literal: true
class FlagOverdueJob < ReservationJob
private
def type
'newly overdue'
end
def new_overdue
collection(:newly_overdue)
end
def prep_collection
new_overdue
end
def run
new_overdue.each do |res|
log_flag res
update res
end
end
def log_... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/email_notes_to_admins_job.rb | app/jobs/email_notes_to_admins_job.rb | # frozen_string_literal: true
class EmailNotesToAdminsJob < ActiveJob::Base
queue_as :default
def perform
Rails.logger.info "Found #{checked_out.size} reservations checked out "\
"with notes and #{checked_in.size} reservations checked in with notes."
unless no_notes
Rails.logger.info 'Sending a... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/email_checkout_reminder_job.rb | app/jobs/email_checkout_reminder_job.rb | # frozen_string_literal: true
class EmailCheckoutReminderJob < ReservationJob
include EmailJobHelper
private
def enabled
AppConfig.check :upcoming_checkout_email_active?
end
def type
'starting today'
end
def run
upcoming_reservations.each do |res|
log_email res
send_email res
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/application_job.rb | app/jobs/application_job.rb | # frozen_string_literal: true
# Base class for Jobs
class ApplicationJob < ActiveJob::Base; end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/email_overdue_reminder_job.rb | app/jobs/email_overdue_reminder_job.rb | # frozen_string_literal: true
class EmailOverdueReminderJob < ReservationJob
include EmailJobHelper
private
def enabled
AppConfig.check :overdue_checkin_email_active?
end
def type
'overdue'
end
def run
overdue_reservations.each do |res|
log_email res
send_email res
end
en... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/delete_old_blackouts_job.rb | app/jobs/delete_old_blackouts_job.rb | # frozen_string_literal: true
class DeleteOldBlackoutsJob < ActiveJob::Base
queue_as :default
def perform
return if disabled
run
clean
Rails.logger.info 'Finished deleting old blackouts.'
end
private
def disabled
AppConfig.check(:blackout_exp_time, '').blank?
end
def run
old_bl... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/daily_tasks_job.rb | app/jobs/daily_tasks_job.rb | # frozen_string_literal: true
class DailyTasksJob < ApplicationJob
queue_as :default
def perform
FlagOverdueJob.perform_now
FlagMissedJob.perform_now
DenyMissedRequestsJob.perform_now
EmailCheckinReminderJob.perform_now
EmailCheckoutReminderJob.perform_now
EmailMissedReservationsJob.perfor... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/deny_missed_requests_job.rb | app/jobs/deny_missed_requests_job.rb | # frozen_string_literal: true
class DenyMissedRequestsJob < ReservationJob
include EmailJobHelper
private
def type
'missed requests'
end
def missed_requests
collection(:missed_requests)
end
def prep_collection
missed_requests
end
def run
missed_requests.each do |r|
log_denia... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/email_checkin_reminder_job.rb | app/jobs/email_checkin_reminder_job.rb | # frozen_string_literal: true
class EmailCheckinReminderJob < ReservationJob
include EmailJobHelper
private
def enabled
AppConfig.check :upcoming_checkin_email_active?
end
def type
'due today'
end
def run
upcoming_reservations.each do |res|
log_email res
send_email res
end
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/jobs/email_missed_reservations_job.rb | app/jobs/email_missed_reservations_job.rb | # frozen_string_literal: true
class EmailMissedReservationsJob < ReservationJob
include EmailJobHelper
private
def enabled
AppConfig.check :send_notifications_for_deleted_missed_reservations
end
def type
'missed'
end
def run
missed_reservations.each do |res|
log_email res
send_... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/reports_helper.rb | app/helpers/reports_helper.rb | # frozen_string_literal: true
module ReportsHelper
require 'csv'
def generate_report_csv_helper(table, name = 'Reservation Set')
CSV.generate do |csv|
csv << [name.titleize] + table.columns.collect(&:name)
table.rows.each do |row|
csv << [row.name] + row.data
end
end
end
def r... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/app_configs_helper.rb | app/helpers/app_configs_helper.rb | # frozen_string_literal: true
module AppConfigsHelper
def current_favicon_and_options
return unless @app_configs.favicon.attached?
'<br><br><strong>Current Favicon: </strong> '\
"#{current_favicon}"
end
private
def current_favicon
resized_favicon = @app_configs
.favi... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/layout_helper.rb | app/helpers/layout_helper.rb | # frozen_string_literal: true
# These helper methods can be called in your template to set variables to be
# used in the layout
# This module should be included in all views globally,
# to do so you may need to add this line to your ApplicationController
# helper :layout
module LayoutHelper
def title(page_title, sh... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/equipment_models_helper.rb | app/helpers/equipment_models_helper.rb | # frozen_string_literal: true
module EquipmentModelsHelper
def evaluate_img_presence(equipment_model)
if equipment_model.photo.attached?
equipment_model.photo.variant(resize: '150x150')
else
'no-image-260.gif'
end
end
def available_item_select_options(em)
items = em.equipment_items.a... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/users_helper.rb | app/helpers/users_helper.rb | # frozen_string_literal: true
module UsersHelper
def active_tab(key)
return 'active' if key == :current_equipment
end
def stats_icons(stat) # rubocop:disable CyclomaticComplexity
return 'fa fa-camera-retro' if stat == :checked_out
return 'fa fa-list-alt' if stat == :future
return 'fa fa-exclamat... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/user_mailer_helper.rb | app/helpers/user_mailer_helper.rb | # frozen_string_literal: true
module UserMailerHelper
VARIABLES = { '@user@' => :reserver,
'@reservation_id@' => :reservation_id,
'@department_name@' => :dept_name,
'@equipment_list@' => :equipment_list,
'@return_date@' => :return_date,
'... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/announcements_helper.rb | app/helpers/announcements_helper.rb | # frozen_string_literal: true
module AnnouncementsHelper
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/contact_helper.rb | app/helpers/contact_helper.rb | # frozen_string_literal: true
module ContactHelper
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/application_helper.rb | app/helpers/application_helper.rb | # frozen_string_literal: true
# Methods added to this helper will be available to all templates in the
# application.
module ApplicationHelper
def markdown(text, filter = true)
return '' if text.blank?
rndr =
Redcarpet::Render::HTML.new(filter_html: filter, safe_links_only: true,
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/categories_helper.rb | app/helpers/categories_helper.rb | # frozen_string_literal: true
module CategoriesHelper
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/equipment_items_helper.rb | app/helpers/equipment_items_helper.rb | # frozen_string_literal: true
module EquipmentItemsHelper
def add_equipment_item_link(name)
# TODO: link_to_function is deprecated and this can probably be removed
link_to_function name do |page|
page.insert_html :bottom, :equipment_model_table,
partial: 'equipment_item',
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/requirements_helper.rb | app/helpers/requirements_helper.rb | # frozen_string_literal: true
module RequirementsHelper
# Builds an HTML string stating if the user has satisfied all requirements for
# the given model
#
# @param current_user [User] The user to check requirements against
# @param em [EquipmentModel] The equipment model to check requirements against
#
#... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/helpers/reservations_helper.rb | app/helpers/reservations_helper.rb | # frozen_string_literal: true
module ReservationsHelper
def filter_message(set, source, filter, view_all)
if view_all
"Viewing all #{filter} reservations"
else
"#{set[filter]} of #{source[filter]} "\
"#{filter.to_s.humanize.downcase} reservations begin between "\
'the specified dates'... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/import_users_controller.rb | app/controllers/import_users_controller.rb | # frozen_string_literal: true
class ImportUsersController < ApplicationController
include CsvImport
helper UsersHelper
authorize_resource class: false
# functions like the RESTful create action by submitting a POST request to
# create/update a bunch of users, and it renders the 'imported' page.
def impor... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/categories_controller.rb | app/controllers/categories_controller.rb | # frozen_string_literal: true
class CategoriesController < ApplicationController
load_and_authorize_resource
decorates_assigned :category
before_action :set_current_category,
only: %i[show edit update destroy deactivate]
include ActivationHelper
include CsvExport
include Calendarable
# ... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/app_configs_controller.rb | app/controllers/app_configs_controller.rb | # frozen_string_literal: true
class AppConfigsController < ApplicationController
authorize_resource class: false
skip_before_action :seen_app_configs, only: [:edit]
def edit
@app_config = AppConfig.first || AppConfig.new
@app_config.update(viewed: true)
end
def update
@app_config = AppConfig.fi... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/requirements_controller.rb | app/controllers/requirements_controller.rb | # frozen_string_literal: true
class RequirementsController < ApplicationController
load_and_authorize_resource
before_action :set_current_requirement,
only: %i[show edit update destroy]
# ------------- before filter methods ------------- #
def set_current_requirement
@requirement = Require... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/import_equipment_controller.rb | app/controllers/import_equipment_controller.rb | # frozen_string_literal: true
class ImportEquipmentController < ApplicationController
include CsvImport
include EquipmentImport
authorize_resource class: false
# modeled after the ImportUsersController
# rubocop disabled pending refactoring
def import # rubocop:disable all
# initialize, we take up to... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/users_controller.rb | app/controllers/users_controller.rb | # frozen_string_literal: true
# rubocop:disable ClassLength
class UsersController < ApplicationController
load_and_authorize_resource
layout 'application_with_sidebar', only: %i[show edit]
autocomplete :user, :last_name, extra_data: %i[first_name username],
display_value: :rend... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/reservations_controller.rb | app/controllers/reservations_controller.rb | # frozen_string_literal: true
# rubocop:disable ClassLength
class ReservationsController < ApplicationController
include ActionView::Helpers::SanitizeHelper
load_and_authorize_resource
before_action :set_reservation,
only: %i[show edit update destroy checkout_email
chec... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/announcements_controller.rb | app/controllers/announcements_controller.rb | # frozen_string_literal: true
class AnnouncementsController < ApplicationController
load_and_authorize_resource
before_action :set_current_announcement, only: %i[edit update destroy]
# ------------- before filter methods ------------- #
def set_current_announcement
@announcement = Announcement.find(params... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/equipment_models_controller.rb | app/controllers/equipment_models_controller.rb | # frozen_string_literal: true
# rubocop:disable ClassLength
class EquipmentModelsController < ApplicationController
layout 'application_with_sidebar', only: :show
load_and_authorize_resource
decorates_assigned :equipment_model
skip_before_action :authenticate_user!, only: %i[show index],
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/contact_controller.rb | app/controllers/contact_controller.rb | # frozen_string_literal: true
class ContactController < ApplicationController
skip_before_action :authenticate_user!, unless: :guests_disabled?
def new
@message = Message.new
end
def create
@message = Message.new(params[:message])
if @message.valid?
NotificationsMailer.new_message(@message).... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/status_controller.rb | app/controllers/status_controller.rb | # frozen_string_literal: true
class StatusController < ActionController::Base
protect_from_forgery with: :exception
def index
render plain: 'Application is running.'
end
end
| ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/blackouts_controller.rb | app/controllers/blackouts_controller.rb | # frozen_string_literal: true
class BlackoutsController < ApplicationController
load_and_authorize_resource
before_action :set_current_blackout,
only: %i[edit show update destroy destroy_recurring]
# ---------- before filter methods ------------ #
def set_current_blackout
@blackout = Blac... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/reports_controller.rb | app/controllers/reports_controller.rb | # frozen_string_literal: true
class ReportsController < ApplicationController
authorize_resource class: false
MODEL_COLUMNS = [['Total', :all, :count],
['Reserved', :reserved, :count],
['Checked Out', :checked_out, :count],
['Overdue', :overdue, :count],
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/equipment_items_controller.rb | app/controllers/equipment_items_controller.rb | # frozen_string_literal: true
# rubocop:disable Metrics/ClassLength
class EquipmentItemsController < ApplicationController
load_and_authorize_resource
decorates_assigned :equipment_item
before_action :set_current_equipment_item,
only: %i[show edit update destroy deactivate
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/catalog_controller.rb | app/controllers/catalog_controller.rb | # frozen_string_literal: true
# rubocop:disable ClassLength
class CatalogController < ApplicationController
helper ReservationsHelper # for request_text
layout 'application_with_sidebar'
before_action :set_equipment_model, only:
%i[add_to_cart remove_from_cart edit_cart_item]
skip_before_action :authentic... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/application_controller.rb | app/controllers/application_controller.rb | # frozen_string_literal: true
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
# rubocop:disable ClassLength
class ApplicationController < ActionController::Base
helper :layout
# See ActionController::RequestF... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/controllers/concerns/calendarable.rb | app/controllers/concerns/calendarable.rb | # frozen_string_literal: true
##
# This concern adds a monthly calendar view of reservations for a given resource
# to a controller. It can be used to provide a standalone view with the
# appropriate routing, but can also be used to insert a `calendar` partial into
# other views. It requires that the `GET :calendar` r... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/report.rb | app/models/report.rb | # frozen_string_literal: true
class Report
attr_accessor :columns, :row_item_type, :rows
DEFAULT_COLUMNS = [['Total', :all, :count],
['Reserved', :reserved, :count],
['Checked Out', :checked_out, :count],
['Overdue', :overdue, :count],
... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
YaleSTC/reservations | https://github.com/YaleSTC/reservations/blob/2d5f0b2511a50787d79023bb3bbd148160dc3cc2/app/models/requirement.rb | app/models/requirement.rb | # frozen_string_literal: true
class Requirement < ApplicationRecord
has_and_belongs_to_many :equipment_models
# This join table associates users with the requirements that they have
# fulfilled. To give a user permission to reserve an item with a
# requirement, go to their Edit page.
has_and_belongs_to_many ... | ruby | MIT | 2d5f0b2511a50787d79023bb3bbd148160dc3cc2 | 2026-01-04T17:43:15.442188Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.