This file contains 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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
gem "rails", github: "rails/rails" | |
gem "sqlite3" | |
end | |
require "active_record" |
This file contains 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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile true, quiet: true do | |
source "https://rubygems.org" | |
gem "rails", "6.0.0" | |
gem "sqlite3" | |
gem "pry" | |
end |
This file contains 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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
gem "rails", "6.0.0" | |
gem "sqlite3" | |
gem "pry" | |
end |
This file contains 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 Array | |
class << self | |
def fold((head, *tail), &block) | |
block::(head, *tail) | |
end | |
end | |
def fold(&block) | |
self.class.fold(self, &block) | |
end |
This file contains 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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
ruby "~> 2.7" | |
gem "rails", github: "rails/rails" | |
gem "sqlite3" |
This file contains 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
# frozen_string_literal: true | |
require 'action_view/template' | |
module LiquidMarkdown | |
class Handler | |
cattr_accessor :markdown_options, default: { autolink: true, tables: true, no_intra_emphasis: true } | |
cattr_accessor :strict_liquid, default: true | |
def self.call(template, source = nil) |
This file contains 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/Gemfile b/Gemfile | |
index 79cc614..9e03100 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -11,6 +11,8 @@ gem 'sqlite3', '~> 1.4' | |
gem 'puma', '~> 3.11' | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 5' | |
+# Bring back uglifier for sprockets | |
+gem 'uglifier', '>= 1.3.0' |
This file contains 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
#!/bin/bash | |
TMPDIR="$(mktemp -d)" | |
CORES=$(sysctl -n hw.ncpu 2>/dev/null || nproc) | |
echo "==> testing with $CORES cores in $TMPDIR" | |
cd $TMPDIR | |
RUBY_VERSION=$(rbenv version-name) | |
TIME=$(which time) |
This file contains 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 Taskable | |
extend ActiveSupport::Concern | |
included do | |
has_many :tasks, as: :taskable | |
end | |
def tasks | |
task_relations.inject(super) do |this, rel| | |
this.or(rel.extending(AllTasks).all_tasks) | |
end |
This file contains 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
def remap_reviewer_ids(table) | |
connection.execute(<<~EOQ) | |
WITH reviewer_map AS ( | |
SELECT reviewers.base_id, to_jsonb(array_agg(DISTINCT profiles.account_id)) | |
FROM profiles | |
JOIN (SELECT jsonb_array_elements(options->'reviewer_ids')::text::int as reviewer_id, id AS base_id FROM #{table}) AS reviewers | |
ON reviewers.reviewer_id = profiles.id | |
GROUP BY base_id | |
) | |
UPDATE #{table} |