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
| 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 |
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
| 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 |
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
| # 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, |
OlderNewer