Skip to content

Instantly share code, notes, and snippets.

View jhawthorn's full-sized avatar
⌨️

John Hawthorn jhawthorn

⌨️
View GitHub Profile
Spree::Image.attachment_definitions[:attachment].update(
s3_credentials: {
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
bucket: ENV['S3_BUCKET_NAME']
},
storage: :s3,
s3_headers: { "Cache-Control" => "max-age=31557600" },
s3_protocol: "https",

We need an improvement to our architecture to allow us to test portions of spree more easily. However I believe we will always need working complete factories form, at least for integration tests.

Regardless of what we're to do in the future. I thought it may be useful to document why all these queries are currently run, and what options we have to reduce their number.

[1] pry(#)> create(:line_item)
module Spree
module Stock
module Splitter
class OneItemPerPackage < Base
cattr_accessor :shipping_category_names do
[]
end
def split(packages)
packages_to_be_processed = packages.select do |package|