[Change!] Describe your feature, problems you had, notes, improvements and others.
[Change!] Upload screenshots of those views you changed.
name: Deploy API Documentation | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy-doc-apiary: | |
name: Push API doc to Apiary |
// Max value of the Minutes Read Graph | |
minutesReadMaxAxis = 810 | |
// Max value of the Views Graph | |
viewsMaxAxis = 431 | |
// Max value of the Visitors Graph | |
visitorsMaxAxis = 344 | |
// First date of the graph (US Format) | |
initialDay = new Date('12/22/2016') | |
// Days in the graphs |
// Run Inspector Console in chrome and copy and paste the following code in the /stats/stories view | |
function download(filename, text) { | |
var pom = document.createElement('a'); | |
pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); | |
pom.setAttribute('download', filename); | |
if (document.createEvent) { | |
var event = document.createEvent('MouseEvents'); | |
event.initEvent('click', true, true); |
# .... | |
gem 'versionist' | |
gem 'jwt' | |
# .... |
# Original: http://www.snip2code.com/Snippet/256399/Amazon-Elastic-Beanstalk-Sidekiq | |
commands: | |
create_pre_dir: | |
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/pre" | |
ignoreErrors: true | |
create_post_dir: | |
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post" | |
ignoreErrors: true | |
create_restartappserver_pre_dir: | |
command: "mkdir /opt/elasticbeanstalk/hooks/restartappserver/pre" |
#!/bin/sh | |
echo 'Running Rspec tests' | |
RUN_CHECK_CMD='bundle exec rspec spec -fd' | |
RUN_TESTS_OUTPUT=`${RUN_CHECK_CMD}` | |
if [ $? -eq 1 ] | |
then | |
echo "Can't commit! You've broken Rspec tests!!!" | |
exit 1 |
class Document < ActiveRecord::Base | |
include UniqueTokenValidator | |
UNIQUE_FIELDS = { | |
key: :name, | |
scope: [:description, :date], | |
condition: proc { |obj| some_method(obj) } | |
} | |
validates UNIQUE_FIELDS[:key], uniqueness: { |
module UniqueTokenValidator | |
extend ActiveSupport::Concern | |
included do | |
validates :unique_token, uniqueness: true, allow_nil: true | |
before_validation :generate_unique_token | |
end | |
def generate_unique_token | |
if !self.class::UNIQUE_FIELDS[:condition].present? || |
class AddNameDescriptionDateUniqueIndexToDocument < ActiveRecord::Migration | |
def change | |
add_index :document, [:name, :description, :date], unique: true | |
end | |
end |