-
-
Save dacook/6c5b7a4699d3299a6dc93d30d65289a0 to your computer and use it in GitHub Desktop.
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
# ansible all-prod -m script -a "check-override-stats.sh" -u ofn-admin -b #--become-user=openfoodnetwork | |
sudo su - openfoodnetwork | |
cd ~/apps/openfoodnetwork/current/ | |
bundle exec rails runner " | |
include ActionView::Helpers::NumberHelper | |
recently_used_overrides = Spree::Variant.select('spree_variants.id').distinct.joins(:variant_overrides).joins(:line_items).where('spree_line_items.updated_at >= ?', 6.months.ago ) | |
puts number_to_percentage recently_used_overrides.where('variant_overrides.count_on_hand is null AND variant_overrides.price is null').count.to_f / recently_used_overrides.count * 100 | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems to hang waiting for something :(