On current master:
$ ruby benchmarkips.rb
0.200000 0.010000 0.210000 ( 0.248978)
$ ruby benchmarkips.rb
0.200000 0.010000 0.210000 ( 0.249966)
$ ruby benchmarkips.rb
function mapValues(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
result[key] = fn(obj[key], key); | |
return result; | |
}, {}); | |
} | |
function pick(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
if (fn(obj[key])) { |
diff --git a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb | |
index c1562fc..f036359 100644 | |
--- a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb | |
+++ b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb | |
@@ -81,12 +81,16 @@ module ActionDispatch | |
return unless logger | |
exception = wrapper.exception | |
+ klass_name = wrapper.exception.class.name | |
+ return if ActionDispatch::ExceptionWrapper.rescue_responses[klass_name] == :not_found |
# in config/environments/test.rb | |
if running_on_ci? | |
config.assets.compile = true | |
config.assets.digest = true | |
end | |
# cache these two dirs: | |
# - tmp/cache/assets/test/sprockets | |
# - public/assets |
# based of https://accessibility.oit.ncsu.edu/blog/2015/02/13/the-incredible-accessible-modal-window-version-3/ | |
class FocusTrap | |
@init = (evt, $domNode) -> | |
focusableElements = 'a[href], button, input:not([disabled]), select:not([disabled]), textarea, *[contenteditable]' | |
if evt.which == 9 | |
o = $domNode.find('*') | |
focusableItems = o.filter(focusableElements).filter(':visible') | |
return unless focusableItems.length |
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', path: '../rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
end |
// | |
var items = payload.shipment.items; | |
var new_items = []; | |
for (i = 0; i < items.length; i++) { | |
var item = items[i]; | |
var quantity = item.quantity; | |
if (item.bundled_items && item.bundled_items.length > 0) { |
On current master:
$ ruby benchmarkips.rb
0.200000 0.010000 0.210000 ( 0.248978)
$ ruby benchmarkips.rb
0.200000 0.010000 0.210000 ( 0.249966)
$ ruby benchmarkips.rb
Spree::LineItem Load (0.3ms) SELECT "spree_line_items".* FROM "spree_line_items" WHERE "spree_line_items"."order_id" = $1 ORDER BY spree_line_items.created_at ASC [["order_id", 12]] | |
Spree::Price Load (0.2ms) SELECT "spree_prices".* FROM "spree_prices" WHERE "spree_prices"."deleted_at" IS NULL AND "spree_prices"."variant_id" = $1 [["variant_id", 1]] | |
(0.1ms) BEGIN | |
Spree::Product Load (0.3ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."id" = $1 LIMIT 1 [["id", 1]] | |
Spree::TaxCategory Load (0.4ms) SELECT "spree_tax_categories".* FROM "spree_tax_categories" WHERE "spree_tax_categories"."deleted_at" IS NULL AND "spree_tax_categories"."id" = $1 LIMIT 1 [["id", 1]] | |
(0.4ms) SELECT SUM("spree_stock_items"."count_on_hand") AS sum_id FROM "spree_stock_items" INNER JOIN "spree_stock_locations" ON "spree_stock_locations"."id" = "spree_stock_items"."stock_location_id" WHERE "spree_stock_items"."deleted_at" IS NULL AND "spree_stock_items"."variant_id" = 1 AND "spree_stock_locatio |
def add_order | |
# do stuff / add the order to shopify and get that order id | |
# | |
# e.g. order = Shopify.create_order @payload | |
# This will do a partial update in Wombat, only the new key | |
# shopify_id will be added everything else will be the same | |
add_object "order", { @payload[:order][:id], shopify_id: order.id } | |
result 200, "Order created!" | |
end |