Sha256: 4a77f61191f481665d6e49dfc25cc5b82e8f4ad89ae69a2925d25dab9c223991

Contents?: true

Size: 852 Bytes

Versions: 22

Compression:

Stored size: 852 Bytes

Contents

require "caboose-store/version"

namespace :caboose_store do
  desc "Initializes the database for a caboose installation"
  task :db => :environment do
    CabooseStore::Schema.create_schema
    CabooseStore::Schema.load_data
  end
  
  desc "Verifies all tables and columns are created."
  task :create_schema => :environment do CabooseStore::Schema.create_schema end
  
  desc "Loads data into caboose tables"
  task :load_data => :environment do CabooseStore::Schema.load_data end
  
  desc "Fix variant sort order"
  task :set_variant_sort_order => :environment do
    CabooseStore::Product.all.each do |p|
      puts "Setting sort order for product #{p.id}..."
      i = 1
      CabooseStore::Variant.where(:product_id => p.id).reorder(:id).all.each do |v|
        v.update_attribute('sort_order', i)
        i = i + 1
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
caboose-store-0.0.43 lib/tasks/caboose-store.rake
caboose-store-0.0.42 lib/tasks/caboose-store.rake
caboose-store-0.0.41 lib/tasks/caboose-store.rake
caboose-store-0.0.40 lib/tasks/caboose-store.rake
caboose-store-0.0.39 lib/tasks/caboose-store.rake
caboose-store-0.0.38 lib/tasks/caboose-store.rake
caboose-store-0.0.37 lib/tasks/caboose-store.rake
caboose-store-0.0.36 lib/tasks/caboose-store.rake
caboose-store-0.0.35 lib/tasks/caboose-store.rake
caboose-store-0.0.34 lib/tasks/caboose-store.rake
caboose-store-0.0.33 lib/tasks/caboose-store.rake
caboose-store-0.0.32 lib/tasks/caboose-store.rake
caboose-store-0.0.31 lib/tasks/caboose-store.rake
caboose-store-0.0.30 lib/tasks/caboose-store.rake
caboose-store-0.0.29 lib/tasks/caboose-store.rake
caboose-store-0.0.28 lib/tasks/caboose-store.rake
caboose-store-0.0.27 lib/tasks/caboose-store.rake
caboose-store-0.0.26 lib/tasks/caboose-store.rake
caboose-store-0.0.25 lib/tasks/caboose-store.rake
caboose-store-0.0.24 lib/tasks/caboose-store.rake