Skip to content

Instantly share code, notes, and snippets.

View BrianDunlap89's full-sized avatar

Brian Dunlap BrianDunlap89

View GitHub Profile
@BrianDunlap89
BrianDunlap89 / gist:9b8cfd7c97bcb03f094e
Created October 28, 2015 13:16
Brian Dunlap -10/28 Quiz
Path Helpers
1. Run the rake routes command in the terminal
2. In the routes file, put \'as: "prefix_name"\'
3. If there are any variables in the route it prefixes, an argument will be required for each variable. Variables are represented as :symbols in the path.
Tying It Back
1. All commands are issued to the API via the terminal, whereas changes by way of the website are done through a web browser.
2. HTML: form class/action and input class/type. Rails equivalents: form_tag and submit_tag, respectively
select distinct
pt.id,
pt.gig_id,
pt.amount,
pt.status,
pt.created_at
from payment_transactions pt
join gigs g on g.id = pt.gig_id
join gig_tip_logs pre_tip_log on pre_tip_log.gig_id = g.id and pre_tip_log.operation = 0
left join gig_tip_logs tip_confirmed_log on tip_confirmed_log.gig_id = g.id and tip_confirmed_log.operation = 1
@BrianDunlap89
BrianDunlap89 / 00_helper_methods.rb
Last active March 29, 2022 14:34
WMT Stale Tip Disbursement (Latest - March 2022)
# Paste these into console
# Change `#create` to `#build` for dry runs in *2* locations
def create_instant_pay_credit_line_item(gig)
gig.line_items.create(category: :promotional_credit, amount: 2, description: "Instant pay credit.")
end
def create_instant_pay_credit_transaction(gig, payment_account, gli)
gig.payment_transactions.create(
payment_account: payment_account,