YARD CHEATSHEET http://yardoc.org
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
ActiveRecord::Schema.define(version: 20160509115901) do | |
create_table "posts", force: :cascade do |t| | |
t.string "title" | |
t.text "body" | |
t.datetime "created_at", null: false | |
t.datetime "updated_at", null: false | |
end | |
create_table "posts_tags", force: :cascade do |t| |
class Post < ActiveRecord::Base | |
has_and_belongs_to_many :tags | |
end |
class PostForm | |
include Virtus | |
include ActiveModel::Model | |
#Post attributes | |
attribute :title, String | |
attribute :body, String | |
#Tag attributes | |
attribute :tags, Array[Integer], default: [] |
class PostForm | |
include Virtus | |
include ActiveModel::Model | |
#Post attributes | |
attribute :post, Object | |
attribute :title, String | |
attribute :body, String | |
#Tag attributes | |
attribute :tags, String # first tag,second tag,third tag |
class PostsController < ApplicationController | |
before_action :set_post, only: [:show, :edit, :update, :destroy] | |
# GET /posts | |
# GET /posts.json | |
def index | |
@posts = Post.all | |
end | |
# GET /posts/1 |
# This is just a cheat sheet: | |
# On production | |
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
# On local | |
scp -C production:~/database.sql.gz | |
dropdb database && createdb database | |
gunzip < database.sql.gz | psql database |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
version: '3' | |
services: | |
db: | |
image: postgres | |
volumes: | |
- db-data:/var/lib/postgresql/data | |
ports: | |
- "5432:5432" | |
environment: | |
- POSTGRES_USER=username |