Skip to content

Instantly share code, notes, and snippets.

View seand7565's full-sized avatar
🙈

Sean Denny seand7565

🙈
View GitHub Profile
@seand7565
seand7565 / order_decorator.rb
Created February 19, 2021 19:51
The order decorator used in the `Customizing Checkout on Solidus` screencast.
# frozen_string_literal: true
# app/decorators/my_app/spree/order_decorator.rb
module MyApp
module Spree
module OrderDecorator
def self.prepended(base)
# base.remove_checkout_step :address
# base.remove_checkout_step :delivery
# base.remove_checkout_step :payment
@seand7565
seand7565 / gist:1f47e9c90abebbf4f5c358f3a0cf7c71
Created November 19, 2020 20:40
Don't Panic - The Solidus Guide to ReactJS Chat Log
2020-09-23 18:02:16 UTC Sean Denny https://github.com/seand7565/solidus-store
2020-09-23 18:03:13 UTC Sean Denny https://www.youtube.com/watch?v=WbWmFtP2bDs
2020-09-23 18:09:49 UTC Sean Denny gem 'react-rails'
2020-09-23 18:10:33 UTC Sean Denny rails webpacker:install
2020-09-23 18:11:06 UTC Sean Denny rails webpacker:install:react
2020-09-23 18:11:37 UTC Sean Denny rails generate react:install
2020-09-23 18:14:19 UTC Sean Denny https://github.com/solidusio/solidus/tree/master/frontend/app/views/spree/products
2020-09-23 18:15:30 UTC Sean Denny <%= javascript_pack_tag 'application' %>
2020-09-23 18:17:55 UTC Sean Denny https://gist.github.com/seand7565/8bfbcebc82472af7bd993ac71715166a
2020-09-23 18:19:44 UTC Sean Denny <%= react_component("Products/Show") %>
@seand7565
seand7565 / states_regenerate.rake
Created October 1, 2020 13:28
Regenerate Solidus states based on current conventions for subregions
# frozen_string_literal: true
# This rake task will gather a list of countries that need to have their states regenerated.
# It will then ask you if you want to destroy all current states of that country and regenerate
# them based off of the current conventions for subregions. If you select yes, all existing states
# that country will be destroyed (and replaced) which could lead to some addresses no longer having
# state references. Proceed with caution!
def get_carmen_states(iso)
carmen_country = Carmen::Country.coded(iso)
return false unless carmen_country&.subregions?
@seand7565
seand7565 / Show.js
Created August 26, 2020 18:57
SolidusConf 2020 Starter Component
import React from "react";
class Show extends React.Component {
constructor() {
super();
this.state = {
name: "Sean"
}
}
@seand7565
seand7565 / solidus_associations_no_inverse
Created June 10, 2020 20:26
Solidus associations with no inverse
=== Spree::Product ===
slugs
option_types
properties
variant_property_rule_values
variant_property_rule_conditions
taxons
promotion_rules
tax_category
prices
@seand7565
seand7565 / solidus_associations
Created June 10, 2020 20:18
Displaying all associations for Solidus and whether or not ActiveRecord knows what the inverse is
=== Spree::Base ===
=== Spree::Product ===
slugs =>
product_option_types => product
option_types =>
product_properties => product
properties =>
variant_property_rules => product
variant_property_rule_values =>
variant_property_rule_conditions =>
@seand7565
seand7565 / benchmark_orders.rake
Last active January 15, 2019 19:41
Benchmark Spree orders
#-----------------------------------------
# Benchmark Orders
#
# Runs numbers on orders with
# different line_item amounts
#
#-----------------------------------------
task :benchmark_orders => :environment do |t, args|
#Setting the position...
[354] pry(main)> Spree::Classification.where(:taxon_id => 140).each.with_index(1) do |t, i| t.set_list_position(i) end
=> [#<Spree::Classification id: 2030, created_at: "2014-01-24 22:50:59", updated_at: "2017-03-02 20:29:08", product_id: 637, taxon_id: 140, position: 1>,
#<Spree::Classification id: 2033, created_at: "2014-01-24 22:50:59", updated_at: "2017-03-02 20:29:08", product_id: 2626, taxon_id: 140, position: 2>,
#<Spree::Classification id: 2032, created_at: "2014-01-24 22:50:59", updated_at: "2017-03-02 20:29:08", product_id: 2625, taxon_id: 140, position: 3>,
#<Spree::Classification id: 2035, created_at: "2014-01-24 22:50:59", updated_at: "2017-03-02 20:29:08", product_id: 2628, taxon_id: 140, position: 4>,
#<Spree::Classification id: 2027, created_at: "2014-01-24 22:50:59", updated_at: "2017-03-02 20:29:08", product_id: 546, taxon_id: 140, position: 5>,
#<Spree::Classification id: 6590, created_at: "2014-04-14 19:32:26", updated_at: "2017-03-02 20:29:08", product_id: 4