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 ApplicationController < ActionController::Base | |
private | |
# Runs a rake task asyncronously in a child process | |
# | |
# for example, in any controller: | |
# async_rake("async:import_fixtures") | |
# async_rake("db:maintenance:cleanup", table: "things", ids: [12, 114, 539]) | |
# |
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
FROM ruby:2.5.5-alpine3.9 as builder | |
WORKDIR /app | |
ARG RAILS_MASTER_KEY | |
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \ | |
BUNDLE_IGNORE_MESSAGES=1 \ | |
BUNDLE_GITHUB_HTTPS=1 \ | |
BUNDLE_FROZEN=1 \ |
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
module Api | |
module V1 | |
class AudiosController < ApplicationController | |
def create | |
return render json: { error: 'File format error.' } unless file_exist? && mp3_exist? | |
return render json: { error: 'Request format error.' } unless artist_exist? && song_exist? | |
audio = Audio.new audio_params |
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
# frozen_string_literal: true | |
class TotemHelper | |
def initialize(params:, model:) | |
@params = params | |
@model = model | |
end | |
# Checks avatar presence of | |
def avatar_present? |
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
# @fn def about_us_menu_pages {{{ | |
# @brief Returns current about_us pages data. They depend on locale and brand | |
# | |
# @return [Array<Hash>] Returns an array of hashes with current pages data | |
# title: page title | |
# filename: file name | |
# href: page url | |
def about_us_menu_pages | |
cached_data = Cache.instance.lazy Cache::TTL::VIEWS, locale: Locale.current do | |
data = [ |
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
# @fn csp_report {{{ | |
# @brief Sends CSP report | |
# | |
# @param [Hash] blob CSP report | |
# @param [String] domain Domain name for multiple CSP Reports | |
def csp_report blob, domain | |
Pony.mail( | |
to: @admin_email, | |
subject: "#{ domain }:CSP Report", |
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
@import base | |
@import static_pages/common | |
#aimees_edit | |
@include scaled_position($width: 114rem, $height: 100rem) | |
position: relative | |
margin: 11rem auto 0 | |
img | |
position: absolute |
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
source 'https://rubygems.org' | |
# users auth~ | |
gem 'devise' | |
gem 'cancancan', '~> 1.10' | |
gem 'rolify' | |
gem 'jquery-smooth-scroll-rails' |