Skip to content

Instantly share code, notes, and snippets.

View ikraamg's full-sized avatar
🌍
Collaborating

Ikraam Ghoor ikraamg

🌍
Collaborating
View GitHub Profile
@ikraamg
ikraamg / console.md
Last active July 6, 2021 16:21
Erd rails generator

https://voormedia.github.io/rails-erd/install.html

gem 'rails-erd'

bundle exec rake erd polymorphism=true filetype='png' notation=bachman filename='erd' exclude='ApplicationRecord,Record,Searchable,PgSearch::Document,ActiveStorage::Attachment,ActiveStorage::Blob,ActionMailbox::Record,ActionText::Record,ActiveStorage::Record', inheritance=true, attributes=content,inheritance,primary_keys,foreign_keys

@ikraamg
ikraamg / script.rb
Last active July 1, 2021 11:05 — forked from cesartalves/script.rb
Import option value to products for `Cans` option_type
cans = Spree::OptionType.find_by!(name: "quantity")
one = Spree::OptionValue.find_by!(name: "quantity-1")
three = Spree::OptionValue.find_by!(name: "quantity-3")
six = Spree::OptionValue.find_by!(name: "quantity-6")
twelve = Spree::OptionValue.find_by!(name: "quantity-12")
twenty_four = Spree::OptionValue.find_by!(name: "quantity-24")
option_value_hash = {
"1" => one,