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
diff --git a/config/environments/development.rb b/config/environments/development.rb | |
index 87ec21e..9f34f1b 100644 | |
--- a/config/environments/development.rb | |
+++ b/config/environments/development.rb | |
@@ -53,7 +53,6 @@ Rails.application.configure do | |
# Highlight code that triggered database queries in logs. | |
config.active_record.verbose_query_logs = true | |
- | |
# Raises error for missing translations. |
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
#!/usr/bin/env bash | |
# Usage: | |
# | |
# First, be sure you're running `git bisect start --no-checkout`, so you can | |
# checkout the bisect head yourself and do some pre-flight stuff like rewind | |
# migrations | |
# | |
# $ git bisect good | |
# Bisecting: 22 revisions left to test after this (roughly 5 steps) |
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
#!/usr/bin/env bash | |
# Useful when you want to git bisect in a rails app and know | |
# you need to `bin/rake db:migrate VERSION="SOMETHING"` before | |
# you check out the next commit so the database is in the right | |
# state, but you don't know what SOMETHING is. | |
# Usage: | |
# | |
# $ migration_version_at_ref <REF> |
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
# The core problem here is mixing levels of abstraction | |
# This unit has two jobs. It delegates one and retains (most of) the | |
# other. That means it's doomed to be partially hands-off | |
# (simply trusting whatever result ProposesAgent sends back) | |
# and otherwise hopelessly in the weeds (requiring | |
# a test to care not only whether the save was valid but how/why) | |
module Proposals | |
class ProposesAgent | |
Result = Struct.new(:success?, :proposal, :error_messages, keyword_init: true) |
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
source 'https://rubygems.org' | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
ruby '2.7.2' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails' | |
# Use Puma as the app server | |
gem 'puma' | |
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Content Manager</title> | |
</head> | |
<body> |
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
--- | |
include: | |
- ".solargraph_definitions.rb" | |
- "app/**/*.rb" | |
- "config/**/*.rb" | |
- "lib/**/*.rb" | |
exclude: | |
- test/**/* | |
- vendor/**/* | |
- ".bundle/**/*" |
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 Organization < ApplicationRecord | |
has_many :users | |
end |
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
<%= form_with model: @user, url: account_path do |f| %> | |
<%= f.text_field :name %> | |
<%= f.email_field :email, disabled: true %> | |
<%= f.submit "Save" %> | |
<% end %> | |
<%= form_with url: login_email_path, method: :delete do |f| %> | |
<%= f.submit "Log out", variant: :reset %> | |
<% end %> |
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
require "date" | |
require "mocktail" | |
require "minitest/autorun" | |
class FetchesOrdersAndItems | |
Result = Struct.new(:orders, :items, keyword_init: true) | |
def fetch(start_date, end_date) | |
end | |
end |