[Change!] Describe your feature, problems you had, notes, improvements and others.
[Change!] Upload screenshots of those views you changed.
set :stage, :production | |
role :app, %w(user@url) | |
role :web, %w(user@url) | |
role :db, %w(user@url) | |
set :bundle_binstubs, -> { shared_path.join('bin') } | |
set :ssh_options, keys: %w(~/.ssh/your-project-production.pem), forward_agent: true |
module.exports = { | |
'production': { | |
'accessKeyId': 'Amazon_s3_production_access_key', | |
'secretAccessKey': 'Amazon_s3_production_secret_key', | |
'region': 'Amazon_s3_production_region', | |
'params': { | |
'Bucket': 'Amazon_s3_production_bucket_name' | |
} | |
}, | |
'productionHeaders': {}, |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "PublicReadGetObject", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", |
aws iam upload-server-certificate \ | |
--server-certificate-name server-certificate-name \ | |
--certificate-body file:///path-to-your-certificate/your-certificate.pem \ | |
--private-key file:///path-to-private-key/private-key.pem \ | |
--certificate-chain file://path-to-chain-certificate/chain-certificate.pem \ | |
--path /cloudfront/ |
class Document < ActiveRecord::Base | |
validates :name, uniqueness: { scope: [:description, :date] } | |
end |
class AddNameDescriptionDateUniqueIndexToDocument < ActiveRecord::Migration | |
def change | |
add_index :document, [:name, :description, :date], unique: true | |
end | |
end |
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? || |
#!/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 |