This file contains hidden or 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 'sidekiq/web' | |
| Sidekiq::Web.use Rack::Auth::Basic do |username, password| | |
| # NOTE: https://github.com/mperham/sidekiq/wiki/Monitoring | |
| ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(username), ::Digest::SHA256.hexdigest(ENV.fetch('ADMIN_NAME'))) & | |
| ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(password), ::Digest::SHA256.hexdigest(ENV.fetch('ADMIN_PASSWORD'))) | |
| end if Rails.env.production? | |
| Rails.application.routes.draw do | |
| mount Sidekiq::Web, at: '/sidekiq' |
This file contains hidden or 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 PurchasedImageUploader < ImageUploader | |
| def store_dir | |
| "purchased_image/#{model.id}" | |
| end | |
| version :small do | |
| def store_dir | |
| "purchased_image/#{model.id}" | |
| end |
This file contains hidden or 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 PurchasedImageUploader < ImageUploader | |
| def store_dir | |
| "purchased_image/#{model.id}" | |
| end | |
| end | |
This file contains hidden or 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 ImageUploader < CarrierWave::Uploader::Base | |
| include CarrierWave::MiniMagick | |
| storage :file | |
| def store_dir | |
| "image/#{model.id}" | |
| end | |
| version :small do |
This file contains hidden or 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
| if [ -f ~/.bashrc ]; then | |
| source ~/.bashrc | |
| fi |
This file contains hidden or 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
| export BUNDLER_EDITOR="/usr/local/bin/subl" | |
| export EDITOR="/usr/local/bin/subl" | |
| ### Added by the Heroku Toolbelt | |
| export PATH="$HOME/.rvm/bin:$PATH" | |
| export PATH="/usr/local/heroku/bin:$PATH" | |
| export PATH="/usr/local/bin:$PATH" | |
| export PATH="/usr/local/sbin:$PATH" | |
| ### Yarn: | |
| export PATH="$HOME/.config/yarn/global/node_modules/.bin:$PATH" |
This file contains hidden or 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 TripReservationsController < ApplicationController | |
| def create | |
| reservation = TripReservation.new(params[:trip_reservation]) | |
| trip = Trip.find_by_id(reservation.trip_id) | |
| agency = trip.agency | |
| payment_adapter = PaymentAdapter.new(buyer: current_user) | |
| unless current_user.can_book_from?(agency) | |
| redirect_to trip_reservations_page, notice: TripReservationNotice.new(:agency_rejection) |
This file contains hidden or 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
| begin | |
| require "bundler/inline" | |
| rescue LoadError => e | |
| $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
| raise e | |
| end | |
| gemfile(true) do | |
| source "https://rubygems.org" | |
| gem "rails", github: "rails/rails" |
This file contains hidden or 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
| --database=postgresql | |
| --skip-action-cable | |
| --skip-spring | |
| --skip-coffee | |
| --skip-turbolinks |
This file contains hidden or 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
| describe "Assets", type: :feature, js: true do | |
| describe "application.js" do | |
| it "does not include page-specific content" do | |
| visit root_path | |
| expect("d3").to be_undefined_in_js | |
| expect("moment").to be_undefined_in_js | |
| end | |
| end |