repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/handle_paypal_event_worker.rb
app/sidekiq/handle_paypal_event_worker.rb
# frozen_string_literal: true class HandlePaypalEventWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :default def perform(paypal_event) PaypalEventHandler.new(paypal_event).handle_paypal_event end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/create_india_sales_report_job.rb
app/sidekiq/create_india_sales_report_job.rb
# frozen_string_literal: true class CreateIndiaSalesReportJob include Sidekiq::Job sidekiq_options retry: 1, queue: :default, lock: :until_executed, on_conflict: :replace VALID_INDIAN_STATES = %w[ AP AR AS BR CG GA GJ HR HP JK JH KA KL MP MH MN ML MZ NL OR PB RJ SK TN TR UK UP WB AN CH DH DD DL ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/send_memberships_price_update_emails_job.rb
app/sidekiq/send_memberships_price_update_emails_job.rb
# frozen_string_literal: true class SendMembershipsPriceUpdateEmailsJob include Sidekiq::Job sidekiq_options retry: 5, queue: :low def perform SubscriptionPlanChange.includes(:subscription) .applicable_for_product_price_change_as_of(7.days.from_now.to_date) .where(notified_subscriber_at: nil) ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/refund_unpaid_purchases_worker.rb
app/sidekiq/refund_unpaid_purchases_worker.rb
# frozen_string_literal: true class RefundUnpaidPurchasesWorker include Sidekiq::Job sidekiq_options retry: 1, queue: :default def perform(user_id, admin_user_id) user = User.find(user_id) return unless user.suspended? unpaid_balance_ids = user.balances.unpaid.ids user.sales.where(purchase_succ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/slack_message_worker.rb
app/sidekiq/slack_message_worker.rb
# frozen_string_literal: true class SlackMessageWorker include Sidekiq::Job sidekiq_options retry: 9, queue: :default SLACK_MESSAGE_SEND_TIMEOUT = 5.seconds SLACK_WEBHOOK_URL = GlobalConfig.get("SLACK_WEBHOOK_URL") ## # Creates a Slack message in a given channel # # All messages from development or s...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/stripe_create_merchant_accounts_worker.rb
app/sidekiq/stripe_create_merchant_accounts_worker.rb
# frozen_string_literal: true class StripeCreateMerchantAccountsWorker include Sidekiq::Job sidekiq_options retry: 1, queue: :default PERIOD_INDICATING_USER_IS_ACTIVE = 3.months private_constant :PERIOD_INDICATING_USER_IS_ACTIVE def perform # Create Stripe accounts for users that have user compliance i...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/cache_product_data_worker.rb
app/sidekiq/cache_product_data_worker.rb
# frozen_string_literal: true class CacheProductDataWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :low, lock: :until_executed def perform(product_id) product = Link.find(product_id) product.invalidate_cache product.product_cached_values.create! end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/check_purchase_heuristics_worker.rb
app/sidekiq/check_purchase_heuristics_worker.rb
# frozen_string_literal: true class CheckPurchaseHeuristicsWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :default def perform(purchase_id) return unless Rails.env.production? sqs = Aws::SQS::Client.new queue_url = sqs.get_queue_url(queue_name: "risk_queue").queue_url sqs.send_mes...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/delete_expired_product_cached_values_worker.rb
app/sidekiq/delete_expired_product_cached_values_worker.rb
# frozen_string_literal: true class DeleteExpiredProductCachedValuesWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :low QUERY_BATCH_SIZE = 200 DELETION_BATCH_SIZE = 100 # Deletes all rows, except the latest one per product. # While still present in the queries for performance, the `expired`...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/charge_successful_preorders_worker.rb
app/sidekiq/charge_successful_preorders_worker.rb
# frozen_string_literal: true class ChargeSuccessfulPreordersWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :default def perform(preorder_link_id) preorder_link = PreorderLink.find_by(id: preorder_link_id) preorder_link.preorders.authorization_successful.each do |preorder| ChargePreo...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/sync_stuck_purchases_job.rb
app/sidekiq/sync_stuck_purchases_job.rb
# frozen_string_literal: true class SyncStuckPurchasesJob include Sidekiq::Job sidekiq_options retry: 1, queue: :default, lock: :until_executed def perform purchase_creation_time_range = Range.new(3.days.ago, 4.hours.ago) Purchase.in_progress.created_between(purchase_creation_time_range).each do |purch...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/expire_rental_purchases_worker.rb
app/sidekiq/expire_rental_purchases_worker.rb
# frozen_string_literal: true class ExpireRentalPurchasesWorker include Sidekiq::Job sidekiq_options retry: 0, queue: :default def perform Purchase.rentals_to_expire.find_each do |purchase| purchase.rental_expired = true purchase.save! end end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/handle_new_bank_account_worker.rb
app/sidekiq/handle_new_bank_account_worker.rb
# frozen_string_literal: true class HandleNewBankAccountWorker include Sidekiq::Job sidekiq_options retry: 10, queue: :default def perform(bank_account_id) bank_account = BankAccount.find(bank_account_id) StripeMerchantAccountManager.handle_new_bank_account(bank_account) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/send_preorder_seller_summary_worker.rb
app/sidekiq/send_preorder_seller_summary_worker.rb
# frozen_string_literal: true class SendPreorderSellerSummaryWorker include Sidekiq::Job sidekiq_options retry: 1, queue: :low MAX_ATTEMPTS_TO_WAIT_FOR_ALL_CHARGED = 72 # roughly 24h, but could be longer if the queue is backed up WAIT_PERIOD = 20.minutes def perform(preorder_link_id, attempts = 0) if a...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/build_tax_rate_cache_worker.rb
app/sidekiq/build_tax_rate_cache_worker.rb
# frozen_string_literal: true class BuildTaxRateCacheWorker include Sidekiq::Job sidekiq_options retry: 1, queue: :default def perform us_tax_cache_namespace = Redis::Namespace.new(:max_tax_rate_per_state_cache_us, redis: $redis) ZipTaxRate.where("state is NOT NULL").group(:state).maximum(:combined_rate...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/send_paypal_topup_notification_job.rb
app/sidekiq/send_paypal_topup_notification_job.rb
# frozen_string_literal: true class SendPaypalTopupNotificationJob include Sidekiq::Job include CurrencyHelper sidekiq_options retry: 1, queue: :default, lock: :until_executed, on_conflict: :replace def perform(notify_only_if_topup_needed = false) return unless Rails.env.production? payout_amount_cen...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/block_stripe_suspected_fraudulent_payments_worker.rb
app/sidekiq/block_stripe_suspected_fraudulent_payments_worker.rb
# frozen_string_literal: true class BlockStripeSuspectedFraudulentPaymentsWorker include Sidekiq::Job sidekiq_options retry: 3, queue: :low TRAILING_DAYS = 90 STRIPE_EMAIL_SENDER = "notifications@stripe.com" HELPER_NOTE_CONTENT = "Done with code" POSSIBLE_CONVERSATION_SUBJECTS = [ "Suspected fraudulen...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/schedule_abandoned_cart_emails_job.rb
app/sidekiq/schedule_abandoned_cart_emails_job.rb
# frozen_string_literal: true class ScheduleAbandonedCartEmailsJob include Sidekiq::Job BATCH_SIZE = 500 sidekiq_options queue: :low, retry: 5, lock: :until_executed def perform # cart_product_ids_with_cart_ids is a hash of { product_id => { cart_id => [variant_ids] } } cart_product_ids_with_cart_id...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/recover_aus_backtax_from_stripe_account_job.rb
app/sidekiq/recover_aus_backtax_from_stripe_account_job.rb
# frozen_string_literal: true class RecoverAusBacktaxFromStripeAccountJob include Sidekiq::Job sidekiq_options retry: 5, queue: :default def perform(creator_id) creator = User.find_by_id(creator_id) return unless creator.present? australia_backtax_agreement = creator.australia_backtax_agreement ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/check_payment_address_worker.rb
app/sidekiq/check_payment_address_worker.rb
# frozen_string_literal: true class CheckPaymentAddressWorker include Sidekiq::Job sidekiq_options retry: 0, queue: :default def perform(user_id) user = User.find_by(id: user_id) return if !user.can_flag_for_fraud? || user.payment_address.blank? banned_accounts_with_same_payment_address = User.wher...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/update_installment_events_count_cache_worker.rb
app/sidekiq/update_installment_events_count_cache_worker.rb
# frozen_string_literal: true class UpdateInstallmentEventsCountCacheWorker include Sidekiq::Job sidekiq_options retry: 1, queue: :low, lock: :until_executed def perform(installment_id) installment = Installment.find(installment_id) total = installment.installment_events.count # This is a hot-fix fo...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/generate_sales_report_job.rb
app/sidekiq/generate_sales_report_job.rb
# frozen_string_literal: true class GenerateSalesReportJob include Sidekiq::Job sidekiq_options retry: 1, queue: :default, lock: :until_executed, on_conflict: :replace ALL_SALES = "all_sales" DISCOVER_SALES = "discover_sales" SALES_TYPES = [ALL_SALES, DISCOVER_SALES] def perform(country_code, start_date,...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/send_workflow_installment_worker.rb
app/sidekiq/send_workflow_installment_worker.rb
# frozen_string_literal: true class SendWorkflowInstallmentWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :low def perform(installment_id, version, purchase_id, follower_id, affiliate_user_id = nil, subscription_id = nil) installment = Installment.find_by(id: installment_id) return if ins...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/generate_community_chat_recap_job.rb
app/sidekiq/generate_community_chat_recap_job.rb
# frozen_string_literal: true class GenerateCommunityChatRecapJob include Sidekiq::Job sidekiq_options queue: :low, retry: 1, lock: :until_executed def perform(community_chat_recap_id) community_chat_recap = CommunityChatRecap.find(community_chat_recap_id) CommunityChatRecapGeneratorService.new(communi...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/log_sendgrid_event_worker.rb
app/sidekiq/log_sendgrid_event_worker.rb
# frozen_string_literal: true class LogSendgridEventWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :mongo def perform(params) events = params["_json"] # Handling potential SendGrid weirdness where sometimes it might not give us an array. events = [events] unless events.is_a?(Array) ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/block_object_worker.rb
app/sidekiq/block_object_worker.rb
# frozen_string_literal: true class BlockObjectWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :default def perform(object_type, identifier, author_id, expires_in = nil) BlockedObject.block!(BLOCKED_OBJECT_TYPES[object_type.to_sym], identifier, author_id, expires_in:) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/handle_stripe_event_worker.rb
app/sidekiq/handle_stripe_event_worker.rb
# frozen_string_literal: true class HandleStripeEventWorker include Sidekiq::Job sidekiq_options retry: 10, queue: :default def perform(params) StripeEventHandler.new(params).handle_stripe_event end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/elasticsearch_indexer_worker.rb
app/sidekiq/elasticsearch_indexer_worker.rb
# frozen_string_literal: true class ElasticsearchIndexerWorker include Sidekiq::Job sidekiq_options retry: 10, queue: :default UPDATE_BY_QUERY_SCROLL_SIZE = 100 # Usage examples: # .perform("index", { "class_name" => "Link", "record_id" => 1 } ) # .perform("delete", { "class_name" => "Link", "record_id" ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/generate_subscribe_preview_job.rb
app/sidekiq/generate_subscribe_preview_job.rb
# frozen_string_literal: true class GenerateSubscribePreviewJob include Sidekiq::Job sidekiq_options retry: 5, queue: :low, lock: :until_executed def perform(user_id) user = User.find(user_id) image = SubscribePreviewGeneratorService.generate_pngs([user]).first if image.blank? raise "Subscri...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/pdf_unstampable_notifier_job.rb
app/sidekiq/pdf_unstampable_notifier_job.rb
# frozen_string_literal: true class PdfUnstampableNotifierJob include Sidekiq::Job sidekiq_options queue: :default, retry: 5 def perform(product_id) product = Link.find(product_id) total_files_checked = 0 total_unstampable_files = 0 product.product_files.alive.pdf.pdf_stamp_enabled.where(stamp...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/invalidate_product_cache_worker.rb
app/sidekiq/invalidate_product_cache_worker.rb
# frozen_string_literal: true class InvalidateProductCacheWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :low, lock: :until_executed def perform(product_id) product = Link.find(product_id) product.invalidate_cache end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/concerns/transcode_event_handler.rb
app/sidekiq/concerns/transcode_event_handler.rb
# frozen_string_literal: true module TranscodeEventHandler private def handle_transcoding_job_notification(job_id, state, transcoded_video_key = nil) transcoded_video_from_job = TranscodedVideo.find_by(job_id:) return if transcoded_video_from_job.nil? TranscodedVideo.processing.where(original_...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/exports/audience_export_worker.rb
app/sidekiq/exports/audience_export_worker.rb
# frozen_string_literal: true class Exports::AudienceExportWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :low, lock: :until_executed def perform(seller_id, recipient_id, audience_options = {}) seller, recipient = User.find(seller_id, recipient_id) recipient ||= seller result = Export...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/exports/affiliate_export_worker.rb
app/sidekiq/exports/affiliate_export_worker.rb
# frozen_string_literal: true class Exports::AffiliateExportWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :low, lock: :until_executed def perform(seller_id, recipient_id) seller, recipient = User.find(seller_id, recipient_id) recipient ||= seller result = Exports::AffiliateExportServ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/exports/sales/process_chunk_worker.rb
app/sidekiq/exports/sales/process_chunk_worker.rb
# frozen_string_literal: true class Exports::Sales::ProcessChunkWorker include Sidekiq::Job # This job is unique because two parallel jobs running `chunks_left_to_process?` could queue the same chunk to be reprocessed. sidekiq_options retry: 5, queue: :low, lock: :until_executed def perform(chunk_id) @chu...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/exports/sales/create_and_enqueue_chunks_worker.rb
app/sidekiq/exports/sales/create_and_enqueue_chunks_worker.rb
# frozen_string_literal: true class Exports::Sales::CreateAndEnqueueChunksWorker include Sidekiq::Job sidekiq_options retry: 5, queue: :low # This is the number of purchases that will be exported in each SalesExportChunk. # It also affects: # - how long it will take to serialize/deserialize that YAML (2.5s/0...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/exports/sales/compile_chunks_worker.rb
app/sidekiq/exports/sales/compile_chunks_worker.rb
# frozen_string_literal: true class Exports::Sales::CompileChunksWorker include Sidekiq::Job # This job is unique because two parallel ProcessChunkWorker jobs could queue this at the same time. sidekiq_options retry: 5, queue: :low, lock: :until_executed def perform(export_id) @export = SalesExport.find(e...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/reports/generate_ytd_sales_report_job.rb
app/sidekiq/reports/generate_ytd_sales_report_job.rb
# frozen_string_literal: true module Reports class GenerateYtdSalesReportJob include Sidekiq::Worker sidekiq_options queue: "low", retry: 3 def perform current_year_start = Time.current.beginning_of_year.iso8601 es_query = { size: 0, query: { bool: { fi...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/onetime/generate_subscribe_previews.rb
app/sidekiq/onetime/generate_subscribe_previews.rb
# frozen_string_literal: true class Onetime::GenerateSubscribePreviews include Sidekiq::Job sidekiq_options retry: 5, queue: :mongo def perform(user_ids) users = User.where(id: user_ids) subscribe_previews = SubscribePreviewGeneratorService.generate_pngs(users) if subscribe_previews.length != users...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/iffy/event_job.rb
app/sidekiq/iffy/event_job.rb
# frozen_string_literal: true class Iffy::EventJob include Sidekiq::Job sidekiq_options retry: 3, queue: :default RECENT_PURCHASE_PERIOD = 1.year EVENTS = %w[ user.banned user.suspended user.compliant record.flagged record.compliant ] def perform(event, id, entity, user = nil) re...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/iffy/product/ingest_job.rb
app/sidekiq/iffy/product/ingest_job.rb
# frozen_string_literal: true class Iffy::Product::IngestJob include Sidekiq::Job sidekiq_options queue: :default, retry: 3 def perform(product_id) product = Link.find(product_id) Iffy::Product::IngestService.new(product).perform end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/iffy/profile/ingest_job.rb
app/sidekiq/iffy/profile/ingest_job.rb
# frozen_string_literal: true class Iffy::Profile::IngestJob include Sidekiq::Job sidekiq_options queue: :default, retry: 3 def perform(user_id) user = User.find(user_id) Iffy::Profile::IngestService.new(user).perform end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/sidekiq/iffy/post/ingest_job.rb
app/sidekiq/iffy/post/ingest_job.rb
# frozen_string_literal: true class Iffy::Post::IngestJob include Sidekiq::Job sidekiq_options queue: :default, retry: 3 def perform(post_id) post = Installment.find(post_id) Iffy::Post::IngestService.new(post).perform end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/comment_mailer.rb
app/mailers/comment_mailer.rb
# frozen_string_literal: true class CommentMailer < ApplicationMailer layout "layouts/email" default from: "noreply@#{CREATOR_CONTACTING_CUSTOMERS_MAIL_DOMAIN}" def notify_seller_of_new_comment(comment_id) @comment = Comment.includes(:commentable).find(comment_id) subject = "New comment on #{@comment....
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/service_mailer.rb
app/mailers/service_mailer.rb
# frozen_string_literal: true class ServiceMailer < ApplicationMailer after_action :deliver_email layout "layouts/email" # service charge emails def service_charge_receipt(service_charge_id) @service_charge = ServiceCharge.find(service_charge_id) @user = @service_charge.user @subject = "Gumroad ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/one_off_mailer.rb
app/mailers/one_off_mailer.rb
# frozen_string_literal: true class OneOffMailer < ApplicationMailer helper InstallmentsHelper layout "layouts/email" # Mailer used to send one-off emails to user, usually via Rails console # `from` email address is not being monitored. If you need to receive replies from users, pass the optional # param `...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/contacting_creator_mailer.rb
app/mailers/contacting_creator_mailer.rb
# frozen_string_literal: true class ContactingCreatorMailer < ApplicationMailer include ActionView::Helpers::NumberHelper include ActionView::Helpers::TagHelper include ActionView::Helpers::UrlHelper include ActionView::Helpers::TextHelper include CurrencyHelper include CustomMailerRouteBuilder include S...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/follower_mailer.rb
app/mailers/follower_mailer.rb
# frozen_string_literal: true class FollowerMailer < ApplicationMailer layout "layouts/email" default from: "Gumroad <noreply@#{FOLLOWER_CONFIRMATION_MAIL_DOMAIN}>" def confirm_follower(followed_user_id, follower_id) @follower = Follower.find(follower_id) @followed_username = User.find(followed_user_id)...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/user_signup_mailer.rb
app/mailers/user_signup_mailer.rb
# frozen_string_literal: true class UserSignupMailer < Devise::Mailer include RescueSmtpErrors helper MailerHelper layout "layouts/email" def email_changed(record, opts = {}) opts[:from] = ApplicationMailer::NOREPLY_EMAIL_WITH_NAME opts[:reply_to] = ApplicationMailer::NOREPLY_EMAIL_WITH_NAME super...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/two_factor_authentication_mailer.rb
app/mailers/two_factor_authentication_mailer.rb
# frozen_string_literal: true class TwoFactorAuthenticationMailer < ApplicationMailer after_action :deliver_email layout "layouts/email" # TODO(ershad): Remove this once the issue with Resend is resolved default delivery_method_options: -> { MailerInfo.default_delivery_method_options(domain: :gumroad) } d...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/admin_mailer.rb
app/mailers/admin_mailer.rb
# frozen_string_literal: true class AdminMailer < ApplicationMailer SUBJECT_PREFIX = ("[#{Rails.env}] " unless Rails.env.production?) default from: ADMIN_EMAIL default to: DEVELOPERS_EMAIL layout "layouts/email" def chargeback_notify(dispute_id) dispute = Dispute.find(dispute_id) @disputable = dis...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/application_mailer.rb
app/mailers/application_mailer.rb
# frozen_string_literal: true class ApplicationMailer < ActionMailer::Base include RescueSmtpErrors, MailerHelper helper MailerHelper # Constants for Gumroad emails { ADMIN_EMAIL: "hi@#{DEFAULT_EMAIL_DOMAIN}", DEVELOPERS_EMAIL: "developers@#{DEFAULT_EMAIL_DOMAIN}", NOREPLY_EMAIL: "noreply@#{DEFAUL...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/creator_mailer.rb
app/mailers/creator_mailer.rb
# frozen_string_literal: true class CreatorMailer < ApplicationMailer helper MailerHelper helper ApplicationHelper helper CurrencyHelper layout "layouts/email" def gumroad_day_fee_saved(seller_id:, to_email: nil) @announcement = true seller = User.find(seller_id) email = to_email.presence || se...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/merchant_registration_mailer.rb
app/mailers/merchant_registration_mailer.rb
# frozen_string_literal: true class MerchantRegistrationMailer < ApplicationMailer default from: ADMIN_EMAIL layout "layouts/email" def account_deauthorized_to_user(user_id, charge_processor_id) @user = User.find(user_id) @charge_processor_display_name = ChargeProcessor::DISPLAY_NAME_MAP[charge_process...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/customer_low_priority_mailer.rb
app/mailers/customer_low_priority_mailer.rb
# frozen_string_literal: true class CustomerLowPriorityMailer < ApplicationMailer include CurrencyHelper helper PreorderHelper helper ProductsHelper include ActionView::Helpers::TextHelper default from: "Gumroad <noreply@#{CUSTOMERS_MAIL_DOMAIN}>" after_action :deliver_subscription_email, only: %i[subscri...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/accounting_mailer.rb
app/mailers/accounting_mailer.rb
# frozen_string_literal: true require "csv" class AccountingMailer < ApplicationMailer SUBJECT_PREFIX = ("[#{Rails.env}] " unless Rails.env.production?) default from: ADMIN_EMAIL_WITH_NAME layout "layouts/email" def funds_received_report(month, year) WithMaxExecutionTime.timeout_queries(seconds: 1.hour)...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/community_chat_recap_mailer.rb
app/mailers/community_chat_recap_mailer.rb
# frozen_string_literal: true class CommunityChatRecapMailer < ApplicationMailer include ActionView::Helpers::TextHelper layout "layouts/email" default from: "noreply@#{CREATOR_CONTACTING_CUSTOMERS_MAIL_DOMAIN}" def community_chat_recap_notification(user_id, seller_id, community_chat_recap_ids) user = U...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/customer_mailer.rb
app/mailers/customer_mailer.rb
# frozen_string_literal: true class CustomerMailer < ApplicationMailer include CurrencyHelper helper CurrencyHelper helper PreorderHelper helper ProductsHelper helper ApplicationHelper layout "layouts/email", except: :send_to_kindle def grouped_receipt(purchase_ids) @chargeables = Purchase.where(id...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/affiliate_request_mailer.rb
app/mailers/affiliate_request_mailer.rb
# frozen_string_literal: true class AffiliateRequestMailer < ApplicationMailer layout "layouts/email" default from: "noreply@#{CUSTOMERS_MAIL_DOMAIN}" def notify_requester_of_request_submission(affiliate_request_id) @affiliate_request = AffiliateRequest.find(affiliate_request_id) @subject = "Your app...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/invite_mailer.rb
app/mailers/invite_mailer.rb
# frozen_string_literal: true class InviteMailer < ApplicationMailer layout "layouts/email" def receiver_signed_up(invite_id) @invite = Invite.find(invite_id) @sender = User.find(@invite.sender_id) @receiver = User.find(@invite.receiver_id) @subject = if @receiver.name.present? "#{@rece...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/affiliate_mailer.rb
app/mailers/affiliate_mailer.rb
# frozen_string_literal: true class AffiliateMailer < ApplicationMailer include NotifyOfSaleHeaders include ActionView::Helpers::TextHelper include BasePrice::Recurrence layout "layouts/email" COLLABORATOR_MAX_PRODUCTS = 5 def direct_affiliate_invitation(affiliate_id, prevent_sending_invitation_email_to...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/team_mailer.rb
app/mailers/team_mailer.rb
# frozen_string_literal: true class TeamMailer < ApplicationMailer include ActionView::Helpers::SanitizeHelper layout "layouts/email" def invite(team_invitation) @team_invitation = team_invitation @seller = team_invitation.seller @seller_name = sanitize(team_invitation.seller.display_name) @sel...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/concerns/custom_mailer_route_builder.rb
app/mailers/concerns/custom_mailer_route_builder.rb
# frozen_string_literal: true module CustomMailerRouteBuilder extend ActiveSupport::Concern def build_mailer_post_route(post:, purchase: nil) return unless post.shown_on_profile? && post.slug.present? user = post.user if user.custom_domain.present? custom_domain_view_post_url( slug: post...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/concerns/notify_of_sale_headers.rb
app/mailers/concerns/notify_of_sale_headers.rb
# frozen_string_literal: true module NotifyOfSaleHeaders extend ActiveSupport::Concern def set_notify_of_sale_headers(is_preorder:) formatted_price = @price || @purchase.try(:formatted_total_price) if @product.is_recurring_billing if @purchase.try(:is_upgrade_purchase) @mail_heading = @subje...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/mailers/concerns/rescue_smtp_errors.rb
app/mailers/concerns/rescue_smtp_errors.rb
# frozen_string_literal: true module RescueSmtpErrors extend ActiveSupport::Concern included do rescue_from ArgumentError do |exception| if exception.message.include? "SMTP To address may not be blank" Rails.logger.error "Mailer Error: #{exception.inspect}" else raise exception ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/channels/community_channel.rb
app/channels/community_channel.rb
# frozen_string_literal: true class CommunityChannel < ApplicationCable::Channel CREATE_CHAT_MESSAGE_TYPE = "create_chat_message" UPDATE_CHAT_MESSAGE_TYPE = "update_chat_message" DELETE_CHAT_MESSAGE_TYPE = "delete_chat_message" def subscribed return reject unless params[:community_id].present? return ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/channels/user_channel.rb
app/channels/user_channel.rb
# frozen_string_literal: true class UserChannel < ApplicationCable::Channel LATEST_COMMUNITY_INFO_TYPE = "latest_community_info" def subscribed return reject unless current_user.present? stream_for "user_#{current_user.external_id}" end def receive(data) case data["type"] when LATEST_COMMUNIT...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/channels/application_cable/channel.rb
app/channels/application_cable/channel.rb
# frozen_string_literal: true module ApplicationCable class Channel < ActionCable::Channel::Base end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/channels/application_cable/connection.rb
app/channels/application_cable/connection.rb
# frozen_string_literal: true module ApplicationCable class Connection < ActionCable::Connection::Base rescue_from StandardError, with: :report_error delegate :session, to: :request identified_by :current_user def connect self.current_user = impersonated_user end private def i...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/docker/base/irbrc.rb
docker/base/irbrc.rb
# frozen_string_literal: true if ENV["RAILS_ENV"] == "production" original_prompt = IRB.conf[:PROMPT][:DEFAULT][:PROMPT_I] new_prompt = "\033[33mPRODUCTION \033[m" + original_prompt IRB.conf[:PROMPT][:DEFAULT][:PROMPT_I] = new_prompt end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds.rb
db/seeds.rb
# frozen_string_literal: true def seed_log(msg) puts msg unless Rails.env.test? end def load_seeds(file) seed_log "Applying seeds in: #{file}" load(file, true) end seed_log "Applying seeds for environment: #{Rails.env}" # Load common seeds. common_directory = __dir__ + "/seeds" Dir[File.join(common_directory,...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/schema.rb
db/schema.rb
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
true
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_braintree_merchant_account_seeds.rb
db/seeds/020_braintree_merchant_account_seeds.rb
# frozen_string_literal: true # Create the shared Braintree merchant accounts if MerchantAccount.gumroad(BraintreeChargeProcessor.charge_processor_id).nil? merchant_account_braintree = MerchantAccount.new merchant_account_braintree.charge_processor_id = BraintreeChargeProcessor.charge_processor_id merchant_accou...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/010_stripe_merchant_account_seeds.rb
db/seeds/010_stripe_merchant_account_seeds.rb
# frozen_string_literal: true # Create the shared Stripe merchant account if MerchantAccount.gumroad(StripeChargeProcessor.charge_processor_id).nil? merchant_account_stripe = MerchantAccount.new merchant_account_stripe.charge_processor_id = StripeChargeProcessor.charge_processor_id merchant_account_stripe.save! ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/030_paypal_merchant_account_seeds.rb
db/seeds/030_paypal_merchant_account_seeds.rb
# frozen_string_literal: true # Create the shared PayPal merchant accounts if MerchantAccount.gumroad(PaypalChargeProcessor.charge_processor_id).nil? paypal_merchant_account = MerchantAccount.new paypal_merchant_account.charge_processor_id = PaypalChargeProcessor.charge_processor_id paypal_merchant_account.charg...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/010_development_staging_test/taxonomy_create.rb
db/seeds/010_development_staging_test/taxonomy_create.rb
# frozen_string_literal: true return if ENV["SKIP_TAXONOMY_CREATION"] == "1" return if Taxonomy.where(slug: "3d").exists? three_d = Taxonomy.find_or_create_by!(slug: "3d") Taxonomy.find_or_create_by!(slug: "3d-modeling", parent: three_d) Taxonomy.find_or_create_by!(slug: "character-design", parent: three_d) Taxonomy....
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/030_staging/mobile_oauth_application.rb
db/seeds/030_staging/mobile_oauth_application.rb
# frozen_string_literal: true mobile_oauth_app = OauthApplication.where(uid: "7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b", secret: "1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b").first mobile_oauth_app = OauthApplication.new if mobile...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/au_tax_rates.rb
db/seeds/020_development_staging/au_tax_rates.rb
# frozen_string_literal: true ZipTaxRate.find_or_create_by(country: "AU").update(combined_rate: 0.10)
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/taxonomy_products.rb
db/seeds/020_development_staging/taxonomy_products.rb
# frozen_string_literal: true def find_or_create_recommendable_user(category_name) user = User.find_by(email: "gumbo_#{category_name}@gumroad.com") return user if user user = User.create!( name: "Gumbo #{category_name}", username: "gumbo#{category_name}", email: "gumbo_#{category_name}@gumroad.com",...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/sg_tax_rates.rb
db/seeds/020_development_staging/sg_tax_rates.rb
# frozen_string_literal: true ZipTaxRate.find_or_create_by(country: "SG", combined_rate: 0.08).update(applicable_years: [2023]) ZipTaxRate.find_or_create_by(country: "SG", combined_rate: 0.09).update(applicable_years: [2024])
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/01_users.rb
db/seeds/020_development_staging/01_users.rb
# frozen_string_literal: true seller = User.find_by(email: "seller@gumroad.com") if seller.blank? seller = User.new seller.email = "seller@gumroad.com" seller.name = "Seller" seller.username = "seller" seller.confirmed_at = Time.current seller.is_team_member = true seller.user_risk_state = "compliant" ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/tax_rates_for_countries_that_collect_on_digital_products.rb
db/seeds/020_development_staging/tax_rates_for_countries_that_collect_on_digital_products.rb
# frozen_string_literal: true ZipTaxRate.find_or_create_by(country: "BH").update(combined_rate: 0.10) # Bahrain ZipTaxRate.find_or_create_by(country: "BY").update(combined_rate: 0.20) # Belarus ZipTaxRate.find_or_create_by(country: "CL").update(combined_rate: 0.19) # Chile ZipTaxRate.find_or_create_by(country: "CO").u...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/tax_rates_for_countries_that_collect_on_all_products.rb
db/seeds/020_development_staging/tax_rates_for_countries_that_collect_on_all_products.rb
# frozen_string_literal: true ZipTaxRate.find_or_create_by(country: "IS").update(combined_rate: 0.24) # Iceland ZipTaxRate.find_or_create_by(country: "IS", flags: 2).update(combined_rate: 0.11) # Iceland ZipTaxRate.find_or_create_by(country: "JP").update(combined_rate: 0.10) # Japan ZipTaxRate.find_or_create_by(countr...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/eu_tax_rates.rb
db/seeds/020_development_staging/eu_tax_rates.rb
# frozen_string_literal: true ZipTaxRate.find_or_create_by(country: "AT").update(combined_rate: 0.20) ZipTaxRate.find_or_create_by(country: "BE").update(combined_rate: 0.21) ZipTaxRate.find_or_create_by(country: "BG").update(combined_rate: 0.20) ZipTaxRate.find_or_create_by(country: "CZ").update(combined_rate: 0.21) Z...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/02_products.rb
db/seeds/020_development_staging/02_products.rb
# frozen_string_literal: true product = Link.fetch("demo") if product.blank? # Demo product used on /widgets page for non-logged in users seller = User.find_by(email: "seller@gumroad.com") seller.products.create!( name: "Beautiful widget", unique_permalink: "demo", description: "Description for demo ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/features.rb
db/seeds/020_development_staging/features.rb
# frozen_string_literal: true features_to_activate = [] features_to_activate.each do |feature| Feature.activate(feature) end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/gumroad_posts.rb
db/seeds/020_development_staging/gumroad_posts.rb
# frozen_string_literal: true email = "hi@gumroad.com" gumroad_user = User.find_by(email:) if gumroad_user.nil? gumroad_user = User.new gumroad_user.email = email gumroad_user.username = "gumroad" gumroad_user.confirmed_at = Time.current gumroad_user.password = SecureRandom.hex(24) gumroad_user.save! # ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/020_development_staging/no_tax_rates.rb
db/seeds/020_development_staging/no_tax_rates.rb
# frozen_string_literal: true ZipTaxRate.find_or_create_by(country: "NO").update(combined_rate: 0.25) ZipTaxRate.find_or_create_by(country: "NO", flags: 2).update(combined_rate: 0.00)
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/030_development/notion_oauth_application.rb
db/seeds/030_development/notion_oauth_application.rb
# frozen_string_literal: true notion_oauth_app = OauthApplication.find_or_initialize_by(name: "Notion (dev)") if notion_oauth_app.new_record? notion_oauth_app.owner = User.find_by(email: "seller@gumroad.com") || User.first notion_oauth_app.scopes = "unfurl" notion_oauth_app.redirect_uri = "https://www.notion.so...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/030_development/products.rb
db/seeds/030_development/products.rb
# frozen_string_literal: true def load_products if Rails.env.production? puts "Shouldn't run product seeds on production" raise end 10.times.each do |i| # create seller user = User.create!( name: "Gumbo #{i}", username: "gumbo#{i}", email: "gumbo#{i}@gumroad.com", password...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/030_development/mobile_oauth_application.rb
db/seeds/030_development/mobile_oauth_application.rb
# frozen_string_literal: true mobile_oauth_app = OauthApplication.where(uid: "7f3a9b2c1d8e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9", secret: "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2").first mobile_oauth_app = OauthApplication.new if mobile_...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/seeds/030_development/helper_oauth_application.rb
db/seeds/030_development/helper_oauth_application.rb
# frozen_string_literal: true helper_oauth_app = OauthApplication.find_or_initialize_by(name: "Helper (dev)") if helper_oauth_app.new_record? helper_oauth_app.owner = User.find_by(email: "seller@gumroad.com") || User.is_team_member.first helper_oauth_app.scopes = "helper_api" helper_oauth_app.redirect_uri = "ht...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151014232700_add_user_id_and_deleted_at_to_zip_tax_rates.rb
db/migrate/20151014232700_add_user_id_and_deleted_at_to_zip_tax_rates.rb
# frozen_string_literal: true class AddUserIdAndDeletedAtToZipTaxRates < ActiveRecord::Migration def change add_column :zip_tax_rates, :user_id, :integer add_column :zip_tax_rates, :deleted_at, :datetime add_index :zip_tax_rates, [:user_id] end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20141008215224_create_user_compliance_info.rb
db/migrate/20141008215224_create_user_compliance_info.rb
# frozen_string_literal: true class CreateUserComplianceInfo < ActiveRecord::Migration def change create_table :user_compliance_info, options: "DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci" do |t| t.references :user t.string :full_name t.string :street_address t.string :city ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20120813212650_add_chargebacked_to_purchases.rb
db/migrate/20120813212650_add_chargebacked_to_purchases.rb
# frozen_string_literal: true class AddChargebackedToPurchases < ActiveRecord::Migration def change add_column :purchases, :chargebacked, :boolean, default: false end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151007000000_add_stripe_identity_document_id_to_user_compliance_info.rb
db/migrate/20151007000000_add_stripe_identity_document_id_to_user_compliance_info.rb
# frozen_string_literal: true class AddStripeIdentityDocumentIdToUserComplianceInfo < ActiveRecord::Migration def change add_column :user_compliance_info, :stripe_identity_document_id, :string end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20221003082314_add_fee_retention_refund_id_to_credits.rb
db/migrate/20221003082314_add_fee_retention_refund_id_to_credits.rb
# frozen_string_literal: true class AddFeeRetentionRefundIdToCredits < ActiveRecord::Migration[6.1] def change add_column :credits, :fee_retention_refund_id, :integer end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20130514223138_create_doorkeeper_tables.rb
db/migrate/20130514223138_create_doorkeeper_tables.rb
# frozen_string_literal: true class CreateDoorkeeperTables < ActiveRecord::Migration def change create_table :oauth_applications do |t| t.string :name, null: false t.string :uid, null: false t.string :secret, null: false t.string :redirect_uri, null: false ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20151001225321_add_cover_image_url_to_installment.rb
db/migrate/20151001225321_add_cover_image_url_to_installment.rb
# frozen_string_literal: true class AddCoverImageUrlToInstallment < ActiveRecord::Migration def change add_column(:installments, :cover_image_url, :string) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20190127011053_add_deleted_from_cdn_at_to_transcoded_videos.rb
db/migrate/20190127011053_add_deleted_from_cdn_at_to_transcoded_videos.rb
# frozen_string_literal: true class AddDeletedFromCdnAtToTranscodedVideos < ActiveRecord::Migration def change add_column :transcoded_videos, :deleted_from_cdn_at, :datetime end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false