View context_for_sign_in_after_confirmation.rb
shared_context 'sign in after confirmation' do |resource_name:| | |
before do | |
@request.env['devise.mapping'] = Devise.mappings[resource_name] | |
end | |
shared_examples 'failed confirmation' do |error:| | |
it { is_expected.to have_http_status :ok } | |
it { is_expected.to render_template 'devise/confirmations/new' } | |
it "has errors on @#{resource_name}" do |
View heroku-16.txt
Format Module Mode Description | |
------------------------------------------------------------------------------- | |
3FR DNG r-- Hasselblad CFV/H3D39II | |
AAI* AAI rw+ AAI Dune image | |
AI PDF rw- Adobe Illustrator CS2 | |
ART* ART rw- PFS: 1st Publisher Clip Art | |
ARW DNG r-- Sony Alpha Raw Image Format | |
AVI MPEG r-- Microsoft Audio/Visual Interleaved | |
AVS* AVS rw+ AVS X image | |
BGR* BGR rw+ Raw blue, green, and red samples |
View find_unused_helpers.rb
#!/usr/bin/env ruby | |
# | |
# Shotgun approach (read: slow and dirty hack) to help find unused helpers in a Rails application | |
# | |
start = Time.now | |
# Build an array of filename globs to process. | |
# Only search file types that might use or define a helper. | |
extensions = %w[rb js haml erb jbuilder].map { |ext| "app/**/**/*.#{ext}" } |
View subscription.json
{ | |
"object": { | |
"id": "sub_Ees5zGujQ85DxG", | |
"object": "subscription", | |
"application_fee_percent": null, | |
"billing": "charge_automatically", | |
"billing_cycle_anchor": 1554603702, | |
"billing_thresholds": null, | |
"cancel_at": null, | |
"cancel_at_period_end": false, |
View 001_add_record_uuid_to_active_storage_attachments.rb
class AddRecordUuidToActiveStorageAttachments < ActiveRecord::Migration[5.2] | |
def change | |
# After applying this migration, you'll need to manually go through your | |
# attachments and populate the new `record_uuid` column. | |
# If you're unable to do this, you'll probably have to delete all your attachments. | |
# You've pretty much got useless garbage data if that's the case :( | |
add_column :active_storage_attachments, :record_uuid, :uuid | |
end | |
end |
View .gitignore
.vagrant |
View attachment-utils.js
window.AttachmentUtils = (function() { | |
var BASE64_MARKER = ';base64,'; | |
var Utils = { | |
// Takes a file size (in bytes) and returns a human-friendly string representation. | |
humanFileSize: function(size) { | |
if(size < 1) return "0 bytes"; | |
// http://stackoverflow.com/a/20732091 |
View page_section_form_controller.js
import { Controller } from "stimulus" | |
class PageSectionFormController extends Controller { | |
initialize() { | |
this.sectionID = parseInt(this.element.getAttribute("data-page-section-id")) | |
this.preview = this.application.getControllerForElementAndIdentifier( | |
document.querySelector(`[data-controller="rich-text-preview"][data-page-section-id="${this.sectionID}"]`), | |
'rich-text-preview', | |
); |
View customer_spec.js
import Customer from 'Customer'; | |
import API from 'API'; | |
import Spies from 'Spies'; | |
beforeEach(() => { | |
Spies.start(); | |
}); | |
afterEach(() => { | |
Spies.stop(); |
View validate_join_model.rb
class Company < ApplicationRecord | |
has_many :employees | |
has_many :projects | |
end | |
class Project < ApplicationRecord | |
belongs_to :company | |
has_many :project_employees |
NewerOlder