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/controllers/admin/users/payout_infos_controller.rb | app/controllers/admin/users/payout_infos_controller.rb | # frozen_string_literal: true
class Admin::Users::PayoutInfosController < Admin::Users::BaseController
before_action :fetch_user
def show
render json: @user.payout_info
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/admin/users/payouts_controller.rb | app/controllers/admin/users/payouts_controller.rb | # frozen_string_literal: true
class Admin::Users::PayoutsController < Admin::BaseController
include Pagy::Backend
before_action :fetch_user, only: [:index, :pause, :resume]
RECORDS_PER_PAGE = 20
private_constant :RECORDS_PER_PAGE
def index
@title = "Payouts"
pagination, @payouts = pagy(
@us... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/admin/users/latest_posts_controller.rb | app/controllers/admin/users/latest_posts_controller.rb | # frozen_string_literal: true
class Admin::Users::LatestPostsController < Admin::Users::BaseController
before_action :fetch_user
def index
render json: @user.last_5_created_posts
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/admin/users/products/tos_violation_flags_controller.rb | app/controllers/admin/users/products/tos_violation_flags_controller.rb | # frozen_string_literal: true
class Admin::Users::Products::TosViolationFlagsController < Admin::Users::Products::BaseController
def index
if @user.flagged_for_tos_violation?
render json: {
tos_violation_flags: @product.comments.with_type_flagged.as_json(
only: %i[id content]
)
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/admin/users/products/base_controller.rb | app/controllers/admin/users/products/base_controller.rb | # frozen_string_literal: true
class Admin::Users::Products::BaseController < Admin::Users::BaseController
before_action :fetch_user
before_action :set_product
private
def set_product
@product = Link.find_by_external_id(params[:product_external_id])
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/admin/search/purchases_controller.rb | app/controllers/admin/search/purchases_controller.rb | # frozen_string_literal: true
class Admin::Search::PurchasesController < Admin::BaseController
include Pagy::Backend
RECORDS_PER_PAGE = 25
def index
@title = "Purchase results"
search_params = params.permit(:transaction_date, :last_4, :card_type, :price, :expiry_date, :purchase_status).to_hash.symboliz... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/admin/search/users_controller.rb | app/controllers/admin/search/users_controller.rb | # frozen_string_literal: true
class Admin::Search::UsersController < Admin::BaseController
include Admin::ListPaginatedUsers
def index
@title = "Search for #{params[:query].present? ? params[:query].strip : "users"}"
@users = User.admin_search(params[:query]).order(created_at: :desc)
list_paginated_u... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/help_center/articles_controller.rb | app/controllers/help_center/articles_controller.rb | # frozen_string_literal: true
class HelpCenter::ArticlesController < HelpCenter::BaseController
before_action :redirect_legacy_articles, only: :show
def index
@props = {
categories: HelpCenter::Category.all.map do |category|
{
title: category.title,
url: help_center_category_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/help_center/categories_controller.rb | app/controllers/help_center/categories_controller.rb | # frozen_string_literal: true
class HelpCenter::CategoriesController < HelpCenter::BaseController
def show
@category = HelpCenter::Category.find_by!(slug: params[:slug])
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/help_center/base_controller.rb | app/controllers/help_center/base_controller.rb | # frozen_string_literal: true
class HelpCenter::BaseController < ApplicationController
layout "help_center"
rescue_from ActiveHash::RecordNotFound, with: :redirect_to_help_center_root
private
def redirect_to_help_center_root
redirect_to help_center_root_path, status: :found
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/media_locations_controller.rb | app/controllers/api/mobile/media_locations_controller.rb | # frozen_string_literal: true
class Api::Mobile::MediaLocationsController < Api::Mobile::BaseController
include RecordMediaLocation
before_action { doorkeeper_authorize! :mobile_api }
def create
render json: { success: record_media_location(params) }
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/subscriptions_controller.rb | app/controllers/api/mobile/subscriptions_controller.rb | # frozen_string_literal: true
class Api::Mobile::SubscriptionsController < Api::Mobile::BaseController
before_action :fetch_subscription_by_external_id, only: :subscription_attributes
def subscription_attributes
render json: { success: true, subscription: @subscription.subscription_mobile_json_data }
end
en... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/installments_controller.rb | app/controllers/api/mobile/installments_controller.rb | # frozen_string_literal: true
class Api::Mobile::InstallmentsController < Api::Mobile::BaseController
before_action :fetch_installment, only: [:show]
before_action :fetch_context_object, only: [:show]
def show
render json: { success: true, installment: @installment.installment_mobile_json_data(purchase: @pu... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/feature_flags_controller.rb | app/controllers/api/mobile/feature_flags_controller.rb | # frozen_string_literal: true
class Api::Mobile::FeatureFlagsController < Api::Mobile::BaseController
before_action { doorkeeper_authorize! :mobile_api }
def show
render json: { enabled_for_user: Feature.active?(params[:id], current_resource_owner) }
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/purchases_controller.rb | app/controllers/api/mobile/purchases_controller.rb | # frozen_string_literal: true
class Api::Mobile::PurchasesController < Api::Mobile::BaseController
before_action { doorkeeper_authorize! :mobile_api }
before_action :fetch_purchase, only: [:purchase_attributes, :archive, :unarchive]
DEFAULT_SEARCH_RESULTS_SIZE = 10
def index
purchases = current_resource_o... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/consumption_analytics_controller.rb | app/controllers/api/mobile/consumption_analytics_controller.rb | # frozen_string_literal: true
class Api::Mobile::ConsumptionAnalyticsController < Api::Mobile::BaseController
include CreateConsumptionEvent
before_action { doorkeeper_authorize! :mobile_api }
def create
render json: { success: create_consumption_event!(params) }
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/devices_controller.rb | app/controllers/api/mobile/devices_controller.rb | # frozen_string_literal: true
class Api::Mobile::DevicesController < Api::Mobile::BaseController
before_action { doorkeeper_authorize! :creator_api, :mobile_api }
def create
device = current_resource_owner.devices.build(device_params)
begin
saved = device.save
rescue ActiveRecord::RecordNotUniq... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/url_redirects_controller.rb | app/controllers/api/mobile/url_redirects_controller.rb | # frozen_string_literal: true
class Api::Mobile::UrlRedirectsController < Api::Mobile::BaseController
before_action :fetch_url_redirect_by_external_id, only: :url_redirect_attributes
before_action :fetch_url_redirect_by_token, only: %i[stream hls_playlist download]
before_action :mark_rental_as_viewed, only: :hl... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/base_controller.rb | app/controllers/api/mobile/base_controller.rb | # frozen_string_literal: true
class Api::Mobile::BaseController < ApplicationController
include Pagy::Backend
before_action :check_mobile_token
rescue_from Pagy::VariableError do |exception|
render status: :bad_request, json: { error: { message: exception.message } }
end
# Secret token that mobile use... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/sales_controller.rb | app/controllers/api/mobile/sales_controller.rb | # frozen_string_literal: true
class Api::Mobile::SalesController < Api::Mobile::BaseController
include ProcessRefund
before_action { doorkeeper_authorize! :mobile_api }
before_action :fetch_purchase, only: [:show]
def show
render json: { success: true, purchase: @purchase.json_data_for_mobile({ include_sa... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/analytics_controller.rb | app/controllers/api/mobile/analytics_controller.rb | # frozen_string_literal: true
class Api::Mobile::AnalyticsController < Api::Mobile::BaseController
before_action -> { doorkeeper_authorize! :creator_api }
before_action :set_date_range, only: [:by_date, :by_state, :by_referral]
def data_by_date
data = SellerMobileAnalyticsService.new(current_resource_owner,... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/sessions_controller.rb | app/controllers/api/mobile/sessions_controller.rb | # frozen_string_literal: true
class Api::Mobile::SessionsController < Api::Mobile::BaseController
before_action { doorkeeper_authorize! :mobile_api }
skip_before_action :verify_authenticity_token, only: :create
def create
sign_in current_resource_owner
render json: { success: true, user: { email: curre... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/mobile/preorders_controller.rb | app/controllers/api/mobile/preorders_controller.rb | # frozen_string_literal: true
class Api::Mobile::PreordersController < Api::Mobile::BaseController
before_action :fetch_preorder_by_external_id, only: :preorder_attributes
def preorder_attributes
render json: { success: true, product: @preorder.mobile_json_data }
end
private
def fetch_preorder_by_ext... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/product_public_files_controller.rb | app/controllers/api/internal/product_public_files_controller.rb | # frozen_string_literal: true
class Api::Internal::ProductPublicFilesController < Api::Internal::BaseController
include FetchProductByUniquePermalink
before_action :authenticate_user!
before_action :fetch_product_and_enforce_ownership, only: :create
after_action :verify_authorized
def create
authorize ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/utm_links_controller.rb | app/controllers/api/internal/utm_links_controller.rb | # frozen_string_literal: true
class Api::Internal::UtmLinksController < Api::Internal::BaseController
before_action :authenticate_user!
after_action :verify_authorized
before_action :set_utm_link, only: [:edit, :update, :destroy]
before_action :authorize_user, only: [:edit, :update, :destroy]
def index
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/carts_controller.rb | app/controllers/api/internal/carts_controller.rb | # frozen_string_literal: true
class Api::Internal::CartsController < Api::Internal::BaseController
def update
if permitted_cart_params[:items].length > Cart::MAX_ALLOWED_CART_PRODUCTS
return render json: { error: "You cannot add more than #{Cart::MAX_ALLOWED_CART_PRODUCTS} products to the cart." }, status:... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/ai_product_details_generations_controller.rb | app/controllers/api/internal/ai_product_details_generations_controller.rb | # frozen_string_literal: true
class Api::Internal::AiProductDetailsGenerationsController < Api::Internal::BaseController
include Throttling
before_action :authenticate_user!
before_action :throttle_ai_requests
after_action :verify_authorized
AI_REQUESTS_PER_PERIOD = 10
AI_REQUESTS_PERIOD_WINDOW = 1.hour
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/collaborators_controller.rb | app/controllers/api/internal/collaborators_controller.rb | # frozen_string_literal: true
class Api::Internal::CollaboratorsController < Api::Internal::BaseController
before_action :authenticate_user!
before_action :set_collaborator, only: %i[edit update destroy]
before_action :authorize_user
after_action :verify_authorized
def index
render json: CollaboratorsPr... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/base_controller.rb | app/controllers/api/internal/base_controller.rb | # frozen_string_literal: true
class Api::Internal::BaseController < ApplicationController
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/existing_product_files_controller.rb | app/controllers/api/internal/existing_product_files_controller.rb | # frozen_string_literal: true
class Api::Internal::ExistingProductFilesController < Api::Internal::BaseController
include FetchProductByUniquePermalink
before_action :authenticate_user!
before_action :fetch_product_by_unique_permalink, only: :index
def index
e404 if @product.user != current_seller
r... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/home_page_numbers_controller.rb | app/controllers/api/internal/home_page_numbers_controller.rb | # frozen_string_literal: true
class Api::Internal::HomePageNumbersController < Api::Internal::BaseController
include ActionView::Helpers::NumberHelper
def index
home_page_numbers = Rails.cache.fetch("homepage_numbers", expires_in: 1.day) do
prev_week_payout_usd = $redis.get(RedisKey.prev_week_payout_usd... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/product_posts_controller.rb | app/controllers/api/internal/product_posts_controller.rb | # frozen_string_literal: true
class Api::Internal::ProductPostsController < Api::Internal::BaseController
include FetchProductByUniquePermalink
before_action :authenticate_user!
before_action :fetch_product_by_unique_permalink, only: :index
def index
e404 if @product.user != current_seller
render js... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/communities_controller.rb | app/controllers/api/internal/communities_controller.rb | # frozen_string_literal: true
class Api::Internal::CommunitiesController < Api::Internal::BaseController
before_action :authenticate_user!
after_action :verify_authorized
def index
authorize Community
render json: CommunitiesPresenter.new(current_user: current_seller).props
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/receipt_previews_controller.rb | app/controllers/api/internal/receipt_previews_controller.rb | # frozen_string_literal: true
class Api::Internal::ReceiptPreviewsController < Api::Internal::BaseController
include FetchProductByUniquePermalink
before_action :authenticate_user!
before_action :fetch_product_by_unique_permalink
def show
e404 if @product.nil? || @product.user != current_seller
@pro... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/communities/chat_messages_controller.rb | app/controllers/api/internal/communities/chat_messages_controller.rb | # frozen_string_literal: true
class Api::Internal::Communities::ChatMessagesController < Api::Internal::BaseController
before_action :authenticate_user!
before_action :set_community
before_action :set_message, only: [:update, :destroy]
after_action :verify_authorized
def index
render json: PaginatedComm... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/communities/last_read_chat_messages_controller.rb | app/controllers/api/internal/communities/last_read_chat_messages_controller.rb | # frozen_string_literal: true
class Api::Internal::Communities::LastReadChatMessagesController < Api::Internal::BaseController
before_action :authenticate_user!
before_action :set_community
after_action :verify_authorized
def create
message = @community.community_chat_messages.find_by_external_id(params[:... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/communities/notification_settings_controller.rb | app/controllers/api/internal/communities/notification_settings_controller.rb | # frozen_string_literal: true
class Api::Internal::Communities::NotificationSettingsController < Api::Internal::BaseController
before_action :authenticate_user!
before_action :set_community
after_action :verify_authorized
def update
settings = current_seller.community_notification_settings.find_or_initial... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/installments/recipient_counts_controller.rb | app/controllers/api/internal/installments/recipient_counts_controller.rb | # frozen_string_literal: true
class Api::Internal::Installments::RecipientCountsController < Api::Internal::BaseController
before_action :authenticate_user!
after_action :verify_authorized
def show
authorize Installment, :updated_recipient_count?
permitted_params = params.permit(
:paid_more_than_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/installments/preview_emails_controller.rb | app/controllers/api/internal/installments/preview_emails_controller.rb | # frozen_string_literal: true
class Api::Internal::Installments::PreviewEmailsController < Api::Internal::BaseController
before_action :authenticate_user!
after_action :verify_authorized
def create
installment = current_seller.installments.alive.find_by_external_id(params[:id])
return e404_json unless i... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/installments/audience_counts_controller.rb | app/controllers/api/internal/installments/audience_counts_controller.rb | # frozen_string_literal: true
class Api::Internal::Installments::AudienceCountsController < Api::Internal::BaseController
before_action :authenticate_user!
after_action :verify_authorized
def show
installment = current_seller.installments.alive.find_by_external_id(params[:id])
return e404_json unless in... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/collaborators/invitation_acceptances_controller.rb | app/controllers/api/internal/collaborators/invitation_acceptances_controller.rb | # frozen_string_literal: true
class Api::Internal::Collaborators::InvitationAcceptancesController < Api::Internal::BaseController
before_action :authenticate_user!
before_action :set_collaborator!
before_action :set_invitation!
after_action :verify_authorized
def create
authorize @invitation, :accept?... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/collaborators/incomings_controller.rb | app/controllers/api/internal/collaborators/incomings_controller.rb | # frozen_string_literal: true
class Api::Internal::Collaborators::IncomingsController < Api::Internal::BaseController
before_action :authenticate_user!
after_action :verify_authorized
def index
authorize Collaborator
incoming_collaborators = scoped_incoming_collaborators
render json: {
coll... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/collaborators/invitation_declines_controller.rb | app/controllers/api/internal/collaborators/invitation_declines_controller.rb | # frozen_string_literal: true
class Api::Internal::Collaborators::InvitationDeclinesController < Api::Internal::BaseController
before_action :authenticate_user!
before_action :set_collaborator!
before_action :set_invitation!
after_action :verify_authorized
def create
authorize @invitation, :decline?
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/utm_links/stats_controller.rb | app/controllers/api/internal/utm_links/stats_controller.rb | # frozen_string_literal: true
class Api::Internal::UtmLinks::StatsController < Api::Internal::BaseController
before_action :authenticate_user!
after_action :verify_authorized
def index
authorize UtmLink
utm_link_ids = current_seller.utm_links.by_external_ids(params[:ids]).pluck(:id)
render json: U... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/utm_links/unique_permalinks_controller.rb | app/controllers/api/internal/utm_links/unique_permalinks_controller.rb | # frozen_string_literal: true
class Api::Internal::UtmLinks::UniquePermalinksController < Api::Internal::BaseController
before_action :authenticate_user!
after_action :verify_authorized
def show
authorize UtmLink, :new?
render json: { permalink: UtmLink.generate_permalink }
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/helper/instant_payouts_controller.rb | app/controllers/api/internal/helper/instant_payouts_controller.rb | # frozen_string_literal: true
class Api::Internal::Helper::InstantPayoutsController < Api::Internal::Helper::BaseController
include CurrencyHelper
before_action :fetch_user
INSTANT_PAYOUT_BALANCE_OPENAPI = {
summary: "Get instant payout balance",
description: "Get the amount available for instant payou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/helper/purchases_controller.rb | app/controllers/api/internal/helper/purchases_controller.rb | # frozen_string_literal: true
class Api::Internal::Helper::PurchasesController < Api::Internal::Helper::BaseController
before_action :fetch_last_purchase, only: [:refund_last_purchase, :resend_last_receipt]
REFUND_LAST_PURCHASE_OPENAPI = {
summary: "Refund last purchase",
description: "Refund last purchas... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/helper/users_controller.rb | app/controllers/api/internal/helper/users_controller.rb | # frozen_string_literal: true
class Api::Internal::Helper::UsersController < Api::Internal::Helper::BaseController
skip_before_action :authorize_helper_token!, only: [:user_info]
before_action :authorize_hmac_signature!, only: [:user_info]
def user_info
render json: { success: false, error: "'email' paramet... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/helper/webhook_controller.rb | app/controllers/api/internal/helper/webhook_controller.rb | # frozen_string_literal: true
class Api::Internal::Helper::WebhookController < Api::Internal::Helper::BaseController
skip_before_action :authorize_helper_token!
before_action :authorize_hmac_signature!
before_action :require_params!
def handle
event = params[:event]
payload = params[:payload]
Rai... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/helper/base_controller.rb | app/controllers/api/internal/helper/base_controller.rb | # frozen_string_literal: true
class Api::Internal::Helper::BaseController < Api::Internal::BaseController
skip_before_action :verify_authenticity_token
before_action :verify_authorization_header!
before_action :authorize_helper_token!
HMAC_EXPIRATION = 1.minute
private
def authorize_hmac_signature!
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/helper/openapi_controller.rb | app/controllers/api/internal/helper/openapi_controller.rb | # frozen_string_literal: true
class Api::Internal::Helper::OpenapiController < Api::Internal::Helper::BaseController
def index
render json: {
openapi: "3.1.0",
info: {
title: "Helper Tools API",
description: "API for Gumroad's Helper Tools",
version: "v1",
},
serve... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/helper/payouts_controller.rb | app/controllers/api/internal/helper/payouts_controller.rb | # frozen_string_literal: true
class Api::Internal::Helper::PayoutsController < Api::Internal::Helper::BaseController
before_action :fetch_user
PAYOUT_INDEX_OPENAPI = {
summary: "Get payout information",
description: "Get last 5 payouts details, next payout date and balance for next payout date",
param... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/iffy/webhook_controller.rb | app/controllers/api/internal/iffy/webhook_controller.rb | # frozen_string_literal: true
class Api::Internal::Iffy::WebhookController < Api::Internal::BaseController
skip_before_action :verify_authenticity_token
before_action :authorize_hmac_signature!
HMAC_EXPIRATION = 1.minute
def handle
event = params.require(:event)
payload = params.require(:payload).per... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/product_review_videos/approvals_controller.rb | app/controllers/api/internal/product_review_videos/approvals_controller.rb | # frozen_string_literal: true
class Api::Internal::ProductReviewVideos::ApprovalsController < Api::Internal::BaseController
before_action :authenticate_user!
before_action :set_product_review_video!
after_action :verify_authorized
def create
authorize @product_review_video, :approve?
@product_review... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/product_review_videos/rejections_controller.rb | app/controllers/api/internal/product_review_videos/rejections_controller.rb | # frozen_string_literal: true
class Api::Internal::ProductReviewVideos::RejectionsController < Api::Internal::BaseController
before_action :authenticate_user!
before_action :set_product_review_video!
after_action :verify_authorized
def create
authorize @product_review_video, :reject?
@product_review... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/internal/grmc/webhook_controller.rb | app/controllers/api/internal/grmc/webhook_controller.rb | # frozen_string_literal: true
class Api::Internal::Grmc::WebhookController < Api::Internal::BaseController
skip_before_action :verify_authenticity_token
before_action :authorize_hmac_signature!
def handle
HandleGrmcCallbackJob.perform_async(JSON.parse(request.body.read))
head :ok
end
private
de... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/custom_fields_controller.rb | app/controllers/api/v2/custom_fields_controller.rb | # frozen_string_literal: true
class Api::V2::CustomFieldsController < Api::V2::BaseController
before_action(only: [:index]) { doorkeeper_authorize!(*Doorkeeper.configuration.public_scopes.concat([:view_public])) }
before_action(only: [:create, :update, :destroy]) { doorkeeper_authorize! :edit_products }
before_a... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/licenses_controller.rb | app/controllers/api/v2/licenses_controller.rb | # frozen_string_literal: true
class Api::V2::LicensesController < Api::V2::BaseController
before_action :log_params, only: [:verify]
before_action :clean_params, only: [:verify]
before_action(only: [:enable, :disable, :decrement_uses_count, :rotate]) { doorkeeper_authorize! :edit_products }
before_action :fetc... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/skus_controller.rb | app/controllers/api/v2/skus_controller.rb | # frozen_string_literal: true
class Api::V2::SkusController < Api::V2::BaseController
before_action -> { doorkeeper_authorize!(*Doorkeeper.configuration.public_scopes.concat([:view_public])) }
before_action :fetch_product
def index
skus = if @product.skus_enabled?
@product.skus.alive.not_is_default_sk... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/variant_categories_controller.rb | app/controllers/api/v2/variant_categories_controller.rb | # frozen_string_literal: true
class Api::V2::VariantCategoriesController < Api::V2::BaseController
before_action(only: [:index, :show]) { doorkeeper_authorize!(*Doorkeeper.configuration.public_scopes.concat([:view_public])) }
before_action(only: [:create, :update, :destroy]) { doorkeeper_authorize! :edit_products ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/links_controller.rb | app/controllers/api/v2/links_controller.rb | # frozen_string_literal: true
class Api::V2::LinksController < Api::V2::BaseController
before_action(only: [:show, :index]) { doorkeeper_authorize!(*Doorkeeper.configuration.public_scopes.concat([:view_public])) }
before_action(only: [:create, :update, :disable, :enable, :destroy]) { doorkeeper_authorize! :edit_pr... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/resource_subscriptions_controller.rb | app/controllers/api/v2/resource_subscriptions_controller.rb | # frozen_string_literal: true
class Api::V2::ResourceSubscriptionsController < Api::V2::BaseController
before_action(only: [:index, :create, :destroy]) { doorkeeper_authorize! :view_sales }
def index
resource_name = params[:resource_name]
if ResourceSubscription.valid_resource_name?(resource_name)
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/users_controller.rb | app/controllers/api/v2/users_controller.rb | # frozen_string_literal: true
class Api::V2::UsersController < Api::V2::BaseController
before_action -> { doorkeeper_authorize!(*Doorkeeper.configuration.public_scopes.concat([:view_public])) }, only: [:show, :ifttt_sale_trigger]
def show
if params[:is_ifttt]
user = current_resource_owner
user.nam... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/subscribers_controller.rb | app/controllers/api/v2/subscribers_controller.rb | # frozen_string_literal: true
class Api::V2::SubscribersController < Api::V2::BaseController
before_action -> { doorkeeper_authorize!(:view_sales) }
before_action :fetch_product, only: :index
RESULTS_PER_PAGE = 100
def index
subscriptions = Subscription.where(link_id: @product.id).active
subscription... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/notion_unfurl_urls_controller.rb | app/controllers/api/v2/notion_unfurl_urls_controller.rb | # frozen_string_literal: true
class Api::V2::NotionUnfurlUrlsController < Api::V2::BaseController
before_action(only: [:create]) { doorkeeper_authorize! :unfurl }
before_action :parse_uri, only: [:create]
before_action :fetch_product, only: [:create]
skip_before_action :verify_authenticity_token, only: [:creat... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/base_controller.rb | app/controllers/api/v2/base_controller.rb | # frozen_string_literal: true
class Api::V2::BaseController < ApplicationController
after_action :log_method_use
private
def fetch_product
products = current_resource_owner.links
@product = products.find_by_external_id(params[:link_id]) || products.find_by(unique_permalink: params[:link_id]) || er... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/sales_controller.rb | app/controllers/api/v2/sales_controller.rb | # frozen_string_literal: true
class Api::V2::SalesController < Api::V2::BaseController
before_action(only: [:index, :show]) { doorkeeper_authorize! :view_sales }
before_action(only: [:mark_as_shipped]) { doorkeeper_authorize! :mark_sales_as_shipped }
before_action(only: [:refund]) { doorkeeper_authorize! :refund... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/payouts_controller.rb | app/controllers/api/v2/payouts_controller.rb | # frozen_string_literal: true
class Api::V2::PayoutsController < Api::V2::BaseController
include PayoutsHelper
before_action -> { doorkeeper_authorize!(:view_payouts) }
RESULTS_PER_PAGE = 10
def index
begin
end_date = Date.strptime(params[:before], "%Y-%m-%d") if params[:before]
rescue Argumen... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/variants_controller.rb | app/controllers/api/v2/variants_controller.rb | # frozen_string_literal: true
class Api::V2::VariantsController < Api::V2::BaseController
before_action(only: [:index, :show]) { doorkeeper_authorize!(*Doorkeeper.configuration.public_scopes.concat([:view_public])) }
before_action(only: [:create, :update, :destroy]) { doorkeeper_authorize! :edit_products }
befor... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/api/v2/offer_codes_controller.rb | app/controllers/api/v2/offer_codes_controller.rb | # frozen_string_literal: true
class Api::V2::OfferCodesController < Api::V2::BaseController
before_action(only: [:index, :show]) { doorkeeper_authorize!(*Doorkeeper.configuration.public_scopes.concat([:view_public])) }
before_action(only: [:create, :update, :destroy]) { doorkeeper_authorize! :edit_products }
bef... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/checkout/upsells_controller.rb | app/controllers/checkout/upsells_controller.rb | # frozen_string_literal: true
class Checkout::UpsellsController < Sellers::BaseController
include Pagy::Backend
PER_PAGE = 20
layout "inertia", only: [:index]
def index
authorize [:checkout, Upsell]
@title = "Upsells"
pagination, upsells = fetch_upsells
upsells_props = Checkout::UpsellsPres... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/checkout/discounts_controller.rb | app/controllers/checkout/discounts_controller.rb | # frozen_string_literal: true
class Checkout::DiscountsController < Sellers::BaseController
include Pagy::Backend
PER_PAGE = 10
before_action :clean_params, only: [:create, :update]
layout "inertia", only: [:index]
def index
authorize [:checkout, OfferCode]
@title = "Discounts"
pagination, o... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/checkout/form_controller.rb | app/controllers/checkout/form_controller.rb | # frozen_string_literal: true
class Checkout::FormController < Sellers::BaseController
layout "inertia", only: [:show]
def show
authorize [:checkout, :form]
@title = "Checkout form"
form_props = Checkout::FormPresenter.new(pundit_user:).form_props
render inertia: "Checkout/Form/Show",
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/checkout/upsells/pauses_controller.rb | app/controllers/checkout/upsells/pauses_controller.rb | # frozen_string_literal: true
class Checkout::Upsells::PausesController < Sellers::BaseController
before_action :set_upsell!
after_action :verify_authorized
def create
authorize [:checkout, @upsell], :pause?
@upsell.update!(paused: true)
head :no_content
end
def destroy
authorize [:check... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/checkout/upsells/products_controller.rb | app/controllers/checkout/upsells/products_controller.rb | # frozen_string_literal: true
class Checkout::Upsells::ProductsController < ApplicationController
include CustomDomainConfig
def index
seller = user_by_domain(request.host) || current_seller
render json: seller.products.eligible_for_content_upsells.map { |product| Checkout::Upsells::ProductPresenter.new(p... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/oauth/tokens_controller.rb | app/controllers/oauth/tokens_controller.rb | # frozen_string_literal: true
class Oauth::TokensController < Doorkeeper::TokensController
include LogrageHelper
private
def strategy
# default to authorization code
params[:grant_type] = "authorization_code" if params[:grant_type].blank?
super
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/oauth/authorizations_controller.rb | app/controllers/oauth/authorizations_controller.rb | # frozen_string_literal: true
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
before_action :hide_layouts
before_action :default_to_authorization_code
before_action :hide_from_search_results
private
def hide_layouts
@hide_layouts = true
end
def hide_from_search_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/oauth/access_tokens_controller.rb | app/controllers/oauth/access_tokens_controller.rb | # frozen_string_literal: true
class Oauth::AccessTokensController < Sellers::BaseController
before_action :set_application
def create
authorize [:settings, :authorized_applications, @application]
access_token = @application.get_or_generate_access_token
render json: { success: true, token: access_toke... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/oauth/applications_controller.rb | app/controllers/oauth/applications_controller.rb | # frozen_string_literal: true
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
protect_from_forgery
include CsrfTokenInjector
include Impersonate
before_action :authenticate_user!
before_action :set_application_params, only: %i[create update]
before_action :set_application, only: ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/oauth/authorized_applications_controller.rb | app/controllers/oauth/authorized_applications_controller.rb | # frozen_string_literal: true
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
def index
redirect_to settings_authorized_applications_path
end
def destroy
application = OauthApplication.authorized_for(current_resource_owner).find_by_external_id(params[:id])
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/oauth/notion/authorizations_controller.rb | app/controllers/oauth/notion/authorizations_controller.rb | # frozen_string_literal: true
class Oauth::Notion::AuthorizationsController < Oauth::AuthorizationsController
before_action :retrieve_notion_bot_token, only: [:new]
private
def retrieve_notion_bot_token
if params[:code].present?
response = NotionApi.new.get_bot_token(code: params[:code], user: c... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/products/other_refund_policies_controller.rb | app/controllers/products/other_refund_policies_controller.rb | # frozen_string_literal: true
class Products::OtherRefundPoliciesController < Sellers::BaseController
include FetchProductByUniquePermalink
def index
fetch_product_by_unique_permalink
authorize @product, :edit?
product_refund_policies = @product.user
.product_refund_policies
.for_visible_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/products/remaining_call_availabilities_controller.rb | app/controllers/products/remaining_call_availabilities_controller.rb | # frozen_string_literal: true
class Products::RemainingCallAvailabilitiesController < ApplicationController
include FetchProductByUniquePermalink
before_action :fetch_product_by_unique_permalink
def index
if @product.native_type == Link::NATIVE_TYPE_CALL
render json: { call_availabilities: @product.r... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/products/archived_controller.rb | app/controllers/products/archived_controller.rb | # frozen_string_literal: true
class Products::ArchivedController < Sellers::BaseController
include ProductsHelper
PER_PAGE = 50
before_action :fetch_product_and_enforce_ownership, only: %i[create destroy]
layout "inertia", only: [:index]
def index
authorize [:products, :archived, Link]
membershi... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/products/mobile_tracking_controller.rb | app/controllers/products/mobile_tracking_controller.rb | # frozen_string_literal: true
class Products::MobileTrackingController < ApplicationController
before_action :hide_layouts
def show
product = Link.fetch(params[:link_id])
@tracking_props = MobileTrackingPresenter.new(seller: product.user).product_props(product:)
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/products/collabs_controller.rb | app/controllers/products/collabs_controller.rb | # frozen_string_literal: true
class Products::CollabsController < Sellers::BaseController
before_action :authorize
layout "inertia", only: [:index]
def index
@title = "Products"
props = CollabProductsPagePresenter.new(**presenter_params).initial_page_props
respond_to do |format|
format.html ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/products/variants_controller.rb | app/controllers/products/variants_controller.rb | # frozen_string_literal: true
class Products::VariantsController < Sellers::BaseController
def index
fetch_product_and_enforce_ownership
authorize [:products, :variants, @product]
render json: @product.options
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/products/affiliated_controller.rb | app/controllers/products/affiliated_controller.rb | # frozen_string_literal: true
class Products::AffiliatedController < Sellers::BaseController
before_action :authorize
layout "inertia", only: [:index]
def index
@title = "Products"
props = AffiliatedProductsPresenter.new(current_seller,
query: affiliated_prod... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/internal/base_controller.rb | app/controllers/internal/base_controller.rb | # frozen_string_literal: true
class Internal::BaseController < ApplicationController
def authorize_request
return render json: { success: false }, status: :unauthorized if request.authorization.nil?
decoded_credentials = ::Base64.decode64(request.authorization.split(" ", 2).last || "").split(":")
userna... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/sellers/switch_controller.rb | app/controllers/sellers/switch_controller.rb | # frozen_string_literal: true
class Sellers::SwitchController < Sellers::BaseController
before_action :skip_authorization
def create
team_membership = find_team_membership!(external_team_membership_id)
switch_seller_account(team_membership)
head :no_content
rescue ActiveRecord::RecordNotFound
h... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/sellers/base_controller.rb | app/controllers/sellers/base_controller.rb | # frozen_string_literal: true
class Sellers::BaseController < ApplicationController
before_action :authenticate_user!
after_action :verify_authorized
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/users/oauth_controller.rb | app/controllers/users/oauth_controller.rb | # frozen_string_literal: true
class Users::OauthController < UsersController
def async_facebook_create
user = User.verify_facebook_login(params[:accessToken])
if user.present?
sign_in user
render json: { success: true }
else
render json: { success: false }
end
end
def async_fac... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/global_affiliates/product_eligibility_controller.rb | app/controllers/global_affiliates/product_eligibility_controller.rb | # frozen_string_literal: true
class GlobalAffiliates::ProductEligibilityController < Sellers::BaseController
class InvalidUrl < StandardError; end
GUMROAD_DOMAINS = [ROOT_DOMAIN, SHORT_DOMAIN, DOMAIN].map { |domain| Addressable::URI.parse("#{PROTOCOL}://#{domain}").domain } # Strip port (in test and development e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/gumroad_blog/posts_controller.rb | app/controllers/gumroad_blog/posts_controller.rb | # frozen_string_literal: true
class GumroadBlog::PostsController < GumroadBlog::BaseController
layout "gumroad_blog"
before_action :hide_layouts
before_action :set_blog_owner!
before_action :set_post, only: [:show]
after_action :verify_authorized
def index
authorize [:gumroad_blog, :posts]
post... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/gumroad_blog/base_controller.rb | app/controllers/gumroad_blog/base_controller.rb | # frozen_string_literal: true
class GumroadBlog::BaseController < ApplicationController
private
def set_blog_owner!
owner_username = GlobalConfig.get("BLOG_OWNER_USERNAME", "gumroad")
@blog_owner = User.find_by!(username: owner_username)
end
end
| ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/product_review_videos/streams_controller.rb | app/controllers/product_review_videos/streams_controller.rb | # frozen_string_literal: true
class ProductReviewVideos::StreamsController < ApplicationController
before_action :set_product_review_video
def show
respond_to do |format|
format.smil { render plain: @product_review_video.video_file.smil_xml }
end
end
private
def set_product_review_video
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/product_review_videos/streaming_urls_controller.rb | app/controllers/product_review_videos/streaming_urls_controller.rb | # frozen_string_literal: true
class ProductReviewVideos::StreamingUrlsController < ApplicationController
before_action :set_product_review_video
after_action :verify_authorized
def index
return head :unauthorized unless authorized?
render json: {
streaming_urls: [
product_review_video_str... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/product_review_videos/upload_contexts_controller.rb | app/controllers/product_review_videos/upload_contexts_controller.rb | # frozen_string_literal: true
class ProductReviewVideos::UploadContextsController < ApplicationController
before_action :authenticate_user!
def show
render json: {
aws_access_key_id: AWS_ACCESS_KEY,
s3_url: "#{AWS_S3_ENDPOINT}/#{S3_BUCKET}",
user_id: logged_in_user.external_id,
}
end
e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/discover/search_autocomplete_controller.rb | app/controllers/discover/search_autocomplete_controller.rb | # frozen_string_literal: true
class Discover::SearchAutocompleteController < ApplicationController
include CreateDiscoverSearch
def search
create_discover_search!(query: params[:query], autocomplete: true) if params[:query].present?
render json: Discover::AutocompletePresenter.new(
query: params[:qu... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/app/controllers/discover/recommended_wishlists_controller.rb | app/controllers/discover/recommended_wishlists_controller.rb | # frozen_string_literal: true
class Discover::RecommendedWishlistsController < ApplicationController
def index
wishlists = RecommendedWishlistsService.fetch(
limit: 4,
current_seller:,
curated_product_ids: (params[:curated_product_ids] || []).map { ObfuscateIds.decrypt(_1) },
taxonomy_id:... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.