ActiveStorage::VariantRecord.find_each(&:destroy)
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 PostsController < ApplicationController | |
| include Confirmable | |
| before_action :build_post, only: %i[index new create] | |
| before_action :find_post, only: %i[show edit update destroy] | |
| before_action :assign_attributes, only: %i[create update] | |
| before_action :authorize_post, only: %i[new create show edit update destroy] | |
| after_action :verify_authorized | |
| after_action :verify_policy_scoped, only: :index |
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 Sqidsable | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| def find(*ids) | |
| expects_array = ids.first.is_a?(Array) | |
| uniq_ids = ids.flatten.compact.uniq | |
| uniq_ids = uniq_ids.first unless expects_array || uniq_ids.size > 1 |
db:migrate: runs migrationsdb:create: creates the databasedb:drop: deletes the databasedb:schema:load: create tables using schema.rb and deleting existing datadb:setup: doesdb:create,db:schema:load,db:seeddb:reset: doesdb:drop,db:create,db:schema:load,db:seeddb:migrate:reset: doesdb:drop,db:create,db:migratedb:prepare: doesdb:setupif database does not exists anddb:migrateif existsdb:seed: load seed fromdb/seeds.rbdb:seed:replant: truncate tables and doesdb:seed
aasm column: :status do
state :pending, initial: true
state :running, :completed, :failed
event :start, success: :success_event_start, after: :after_event_start, after_commit: :after_commit_event_start do
transitions from: :pending, to: :running,
after: :after_transition_from_pending_to_running,
success: :success_transition_from_pending_to_running
endPor defecto en Ubuntu, cuando instalamos openssh-server se generan 4 claves públicas con sus correspondientes
claves privadas usando cada una un algoritmo diferente:
/etc/sshd/ssh_host_dsa_key.pub- ssh-dss/etc/sshd/ssh_host_ecdsa_key.pub- ecdsa-sha2-nistp256/etc/sshd/ssh_host_ed25519_key.pub- ssh-ed25519/etc/sshd/ssh_host_rsa_key.pub- ssh-rsa
NewerOlder