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
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
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
export function saveOfficeStaff(section, staff) { | |
return (dispatch, getState) => { | |
const issue = getState().newsletterId; | |
const theData = { | |
staff: staff, | |
section_id: section.id | |
} | |
fetch(`/api/newsletters/${issue}/office_staff`, { |
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 ParseEntries | |
def process(message) | |
entry = JSON.parse(message.value) | |
[entry] | |
end | |
end | |
class CombineEntries | |
def initialize | |
@open_transactions = {} |
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 paginate(scope, default_per_page = 20) | |
collection = scope.page(params[:page]).per((params[:per_page] || default_per_page).to_i) | |
current, total, per_page = collection.current_page, collection.num_pages, collection.limit_value | |
return [{ | |
pagination: { | |
current: current, | |
previous: (current > 1 ? (current - 1) : nil), | |
next: (current == total ? nil : (current + 1)), |
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
# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version | |
# see https://github.com/defunkt/resque/issues/49 | |
# see http://redis.io/commands - new commands | |
namespace :resque do | |
desc "Clear pending tasks" | |
task :clear => :environment do | |
queues = Resque.queues | |
queues.each do |queue_name| | |
puts "Clearing #{queue_name}..." |