Instantly share code, notes, and snippets.

View stack_trace.rb
NameError: uninitialized constant Workers::Subscription
Did you mean? RUBY_DESCRIPTION
const_missing at org/jruby/RubyModule.java:3348
<main> at /src/repo/spec/workers/subscription/cancel_spec.rb:3
require at org/jruby/RubyKernel.java:961
block in -e at -e:1
glob at org/jruby/RubyDir.java:233
<main> at -e:1
View avatax_sales_receipt.rb
{"id"=>313728202, "code"=>"25b54cc0-3f49-4f9a-aac7-174a5ee43f70", "companyId"=>636231, "date"=>"2017-06-26", "paymentDate"=>"1900-01-01", "status"=>"Saved", "type"=>"SalesInvoice", "batchCode"=>"", "currencyCode"=>"USD", "customerUsageType"=>"", "customerVendorCode"=>"mohammed@schaden.co.uk", "exemptNo"=>"", "reconci
led"=>false, "purchaseOrderNo"=>"GLO195104244742", "referenceCode"=>"", "salespersonCode"=>"", "taxOverrideType"=>"None", "taxOverrideAmount"=>0.0, "taxOverrideReason"=>"", "totalAmount"=>1.0, "totalExempt"=>1.0, "totalTax"=>0.0, "totalTaxable"=>0.0, "totalTaxCalculated"=>0.0, "adjustmentReason"=>"NotAdjusted", "adju
stmentDescription"=>"", "locked"=>false, "region"=>"NY", "country"=>"US", "version"=>1, "softwareVersion"=>"17.6.3.5", "originAddressId"=>797558954, "destinationAddressId"=>797558955, "exchangeRateEffectiveDate"=>"2017-06-26", "exchangeRate"=>1.0, "isSellerImporterOfRecord"=>false, "description"=>"Spree Order", "busi
nessIdentificationNo"=>"", "modifiedDate"=>"2017-06-26T14:19:00.323
View docker_changing.yml
version: '2'
services:
db:
image: kiasaki/alpine-postgres
volumes:
- ./pgdata:/pgdata
environment:
POSTGRES_DB: some_db
POSTGRES_USER: postgres
PGDATA: /pgdata
View api_setup.rb
RSpec.shared_context 'api_setup' do
let!(:user) { create :user }
before :each do
user.generate_spree_api_key!
end
let(:headers) do
{
'Accept' => 'application/json',
View _replenishment.html.slim
= render partial: "mobile_close"
h1 #{t('account.replenishment.title')}
- if spree_current_user.subscriptions.any?
.g-mar--top.g-mar--xs--7
- user_subscriptions = Glossier::UserSubscriptionsSerializer.new(spree_current_user).to_json
glo-subscriptions user-subscriptions="#{user_subscriptions}"
- else
View mount.js
var vm = new Vue({
template: '<div><test></test></div>',
components: {
'test': ComponentA
}
}).$mount()
View address_book#delete
DELETE /api/users/1/address_book
+ Request (application/json)
+ Headers
address_id: 1
Accept: application/json
X-Spree-Token: 67d51a299b8db52330748899dd7a225b8ecb511bc5452f00
View subscription_mailer_preview.rb
class SubscriptionMailerPreview < ActionMailer::Preview
def renewal_fail
order = Spree::Order.last
subscription = Spree::Order.last.subscription
raise 'An order and subscription is required in the DB' unless order && subscription
::SubscriptionMailer.renewal_fail(order, subscription)
end
end
View welcome.rb
module Components
module Home
class Welcome < React::Component::Base # :nodoc:
param :title, type: String
def render
h1 { "Welcome to #{params.title}!" }
end
end
end
View _subscriptions.html.slim
h2.account__title Your Subscriptions
- user.subscriptions.each_with_index do |sub, idx|
.subscriptions
.subscriptions__section.text-xs-center
h5.m-b-1 = "Subscriptions ##{idx}
.subscriptions__products
- sub.items.each do |item|
.subscriptions__product
= image_tag item.account_image