Make note of upstream sha
when templated: 2add9da
(https://cln.sh/ETfqYT) and
the first commit sha
from templated new repo: 85f49ba
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
An error occurred while Layout/LineLength cop was inspecting /Users/peterberkenbosch/code/solidusio-contrib/solidus_affirm_v2/spec/views/spree/checkout/payment/affirm_v2_spec.rb:14:4. | |
can't modify frozen Array | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/mixin/check_line_breakable.rb:174:in `pop' | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/mixin/check_line_breakable.rb:174:in `process_args' | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/mixin/check_line_breakable.rb:47:in `extract_breakable_node' | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/layout/line_length.rb:102:in `check_for_breakable_node' | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/layout/line_length.rb:75:in `on_potential_breakable_node' | |
/Users/peterberkenbosch/.gem/ruby/2.6.6/gems/rubocop-0.87.1/lib/rubocop/cop/commissioner.rb:91:in `block (2 levels) in trigger_responding_cops' | |
/Users/peterberkenbo |
In this small guide I will share the setup I use to contribute to SpreeCommerce.
Disclaimer: This post contains some content written by me and others for the developer guides at SpreeCommerce.
Fork the repo the spree repository on github and clone the spree project on your local machine:
git clone YOUR-REPO-URL
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
set = [1.1, 1.2, 0.85, 2.0, 1.3, 3.2] | |
geo_avg = (set.inject{|a,b| a*b}) ** (1.0/set.size) |
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
Spree.config do |config| | |
config.send_core_emails = false | |
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
config.payload_builder = { | |
#... rest omitted for clearity. | |
"Spree::Order" => { serializer: "Spree::Wombat::OrderSerializer", root: "orders", filter: "complete" } | |
} |
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
Spree::Order.class_eval do | |
after_commit :wombat_push_spree_orders | |
def wombat_push_spree_orders | |
if self.state == "complete" | |
payload_builder = Spree::Wombat::Config[:payload_builder]["Spree::Order"] | |
payload = ActiveModel::ArraySerializer.new([order], | |
each_serializer: payload_builder[:serializer].constantize, | |
root: payload_builder[:root] | |
).to_json | |
Spree::Wombat::Client.push(payload) |
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
attachment_config = { | |
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" }, |
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
Spree::LineItem.joins(:variant).merge(Spree::Variant.where(sku: "ROR-00011")).joins(:order).merge(Spree::Order.where(state: 'complete')).count |
NewerOlder