-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements autoloading on Active Resources classes so they don't load early unnecessarily. This improves load times for Rails applications, especially in instances where they are not used.
- Loading branch information
Showing
7 changed files
with
132 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,98 @@ | ||
# frozen_string_literal: true | ||
require 'shopify_api/resources/base' | ||
require 'shopify_api/resources/array_base' | ||
Dir.glob("#{File.dirname(__FILE__)}/resources/*").each { |file| require(file) } | ||
|
||
module ShopifyAPI | ||
eager_autoload do | ||
autoload_under('resources') do | ||
autoload(:Base) | ||
autoload(:ArrayBase) | ||
autoload(:AbandonedCheckout) | ||
autoload(:AccessScope) | ||
autoload(:AccessToken) | ||
autoload(:Address) | ||
autoload(:Announcement) | ||
autoload(:ApiPermission) | ||
autoload(:ApplicationCharge) | ||
autoload(:ApplicationCredit) | ||
autoload(:ArrayBase) | ||
autoload(:Article) | ||
autoload(:Asset) | ||
autoload(:AssignedFulfillmentOrder) | ||
autoload(:Base) | ||
autoload(:BillingAddress) | ||
autoload(:Blog) | ||
autoload(:CarrierService) | ||
autoload(:Cart) | ||
autoload(:Checkout) | ||
autoload(:Collect) | ||
autoload(:Collection) | ||
autoload(:CollectionListing) | ||
autoload(:CollectionPublication) | ||
autoload(:Comment) | ||
autoload(:Country) | ||
autoload(:Currency) | ||
autoload(:CustomCollection) | ||
autoload(:Customer) | ||
autoload(:CustomerGroup) | ||
autoload(:CustomerInvite) | ||
autoload(:CustomerSavedSearch) | ||
autoload(:DiscountCode) | ||
autoload(:DiscountCodeBatch) | ||
autoload(:DraftOrder) | ||
autoload(:DraftOrderInvoice) | ||
autoload(:Event) | ||
autoload(:Fulfillment) | ||
autoload(:FulfillmentEvent) | ||
autoload(:FulfillmentOrder) | ||
autoload(:FulfillmentOrderLocationsForMove) | ||
autoload(:FulfillmentRequest) | ||
autoload(:FulfillmentService) | ||
autoload(:FulfillmentV2) | ||
autoload(:GiftCard) | ||
autoload(:Image) | ||
autoload(:InventoryItem) | ||
autoload(:InventoryLevel) | ||
autoload(:LineItem) | ||
autoload(:Location) | ||
autoload(:MarketingEvent) | ||
autoload(:Metafield) | ||
autoload(:NoteAttribute) | ||
autoload(:Option) | ||
autoload(:Order) | ||
autoload(:OrderRisk) | ||
autoload(:Page) | ||
autoload(:Payment) | ||
autoload(:PaymentDetails) | ||
autoload(:Policy) | ||
autoload(:PriceRule) | ||
autoload(:Product) | ||
autoload(:ProductListing) | ||
autoload(:ProductPublication) | ||
autoload(:Province) | ||
autoload(:Publication) | ||
autoload(:Receipt) | ||
autoload(:RecurringApplicationCharge) | ||
autoload(:Redirect) | ||
autoload(:Refund) | ||
autoload(:Report) | ||
autoload(:ResourceFeedback) | ||
autoload(:Rule) | ||
autoload(:ScriptTag) | ||
autoload(:ShippingAddress) | ||
autoload(:ShippingLine) | ||
autoload(:ShippingRate) | ||
autoload(:ShippingZone) | ||
autoload(:Shop) | ||
autoload(:SmartCollection) | ||
autoload(:StorefrontAccessToken) | ||
autoload(:TaxLine) | ||
autoload(:TaxService) | ||
autoload(:TenderTransaction) | ||
autoload(:Theme) | ||
autoload(:Transaction) | ||
autoload(:UsageCharge) | ||
autoload(:User) | ||
autoload(:Variant) | ||
autoload(:Webhook) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.