use Gemfile.lock
This commit is contained in:
parent
f3f888156b
commit
4f5bedd22c
|
|
@ -20,4 +20,4 @@ artifacts
|
|||
*.iml
|
||||
.idea
|
||||
BUILD_NUMBER
|
||||
Gemfile.lock
|
||||
# Gemfile.lock
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ ActiveAdmin.register_page "POSA Card Uploads" do
|
|||
|
||||
redirect_to admin_posa_card_uploads_path, :notice => "Created #{array_of_arrays.length} POSA cards!"
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
=begin
|
||||
|
|
@ -59,6 +61,45 @@ ActiveAdmin.register_page "POSA Card Uploads" do
|
|||
f.actions
|
||||
|
||||
end
|
||||
|
||||
# fr manual entry of huge CSVs from rails c command line
|
||||
|
||||
PosaCard.transaction do
|
||||
|
||||
|
||||
array_of_arrays = CSV.read('codes.csv')
|
||||
array_of_arrays.each do |row|
|
||||
if row.length != 5
|
||||
raise "UKNONWN CSV FORMAT! Must be 5 columns"
|
||||
end
|
||||
|
||||
code = row[0]
|
||||
lesson_package_type = row[1]
|
||||
preactivate = row[2].strip.downcase == "true"
|
||||
requires_purchase = row[3].downcase== "true"
|
||||
is_test = row[4].strip.downcase == "true"
|
||||
|
||||
posa_card = PosaCard.new
|
||||
posa_card.code = code
|
||||
posa_card.lesson_package_type = LessonPackageType.find(lesson_package_type)
|
||||
posa_card.preactivate = preactivate
|
||||
posa_card.requires_purchase = requires_purchase
|
||||
posa_card.purchased = !requires_purchase
|
||||
posa_card.card_type = 'jam_class_2'
|
||||
posa_card.is_test = is_test
|
||||
|
||||
|
||||
if posa_card.card_type == PosaCard::JAM_CLASS_4
|
||||
posa_card.is_lesson = true
|
||||
posa_card.credits = 4
|
||||
elsif posa_card.card_type == PosaCard::JAM_CLASS_2
|
||||
posa_card.is_lesson = true
|
||||
posa_card.credits = 2
|
||||
end
|
||||
posa_card.origin = 'posa-cards-amazon-test-drive-paid-4-50k.csv'
|
||||
posa_card.save!
|
||||
end
|
||||
end
|
||||
=end
|
||||
|
||||
content do
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ cp ../ruby/jam_ruby-${GEM_VERSION}.gem vendor/cache/ || { echo "unable to copy j
|
|||
|
||||
# put all dependencies into vendor/bundle
|
||||
#rm -rf vendor/bundle -- let jenkins config 'wipe workspace' decide this
|
||||
rm Gemfile.lock # if we don't want versions to float, pin it in the Gemfile, not count on Gemfile.lock
|
||||
# rm Gemfile.lock # if we don't want versions to float, pin it in the Gemfile, not count on Gemfile.lock
|
||||
bundle install --path vendor/bundle
|
||||
#bundle update
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
.bundle
|
||||
.config
|
||||
.yardoc
|
||||
Gemfile.lock
|
||||
# Gemfile.lock
|
||||
InstalledFiles
|
||||
_yardoc
|
||||
coverage
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ jt_metadata.json
|
|||
|
||||
artifacts
|
||||
|
||||
Gemfile.lock
|
||||
#Gemfile.lock
|
||||
.sass-cache
|
||||
log/development.log.age
|
||||
log/test.log.age
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ mkdir $DIR/target/deb
|
|||
#rm -rf vendor/bundle -- let jenkins config wipe workspace, or not
|
||||
|
||||
rm -rf tmp/capybara
|
||||
rm -f Gemfile.lock # if we don't want versions to float, pin it in the Gemfile, not count on Gemfile.lock
|
||||
#rm -f Gemfile.lock # if we don't want versions to float, pin it in the Gemfile, not count on Gemfile.lock
|
||||
# put all dependencies into vendor/bundle
|
||||
|
||||
# default build number to 1 if not found
|
||||
|
|
|
|||
|
|
@ -60,20 +60,20 @@ namespace :lessons do
|
|||
|
||||
task amazon_gift_cards: :environment do|task, args|
|
||||
CSV.open("posa-cards-amazon-test-drive-paid-4.csv", "wb") do |csv|
|
||||
for i in 1..250
|
||||
csv << [generate(), 'amazon-test-drive-paid-4', true, true]
|
||||
for i in 1..50000
|
||||
csv << [generate(), 'amazon-test-drive-paid-4', true, true, false]
|
||||
end
|
||||
end
|
||||
|
||||
CSV.open("posa-cards-amazon-test-drive-free-4.csv", "wb") do |csv|
|
||||
for i in 1..250
|
||||
csv << [generate(), 'amazon-test-drive-free-4',true, false]
|
||||
for i in 1..50000
|
||||
csv << [generate(), 'amazon-test-drive-free-4',true, false, false]
|
||||
end
|
||||
end
|
||||
|
||||
CSV.open("posa-cards-amazon-test-drive-free-2.csv", "wb") do |csv|
|
||||
for i in 1..250
|
||||
csv << [generate(), 'amazon-test-drive-free-2',true, false]
|
||||
for i in 1..50000
|
||||
csv << [generate(), 'amazon-test-drive-free-2',true, false, false]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
.bundle
|
||||
.config
|
||||
.yardoc
|
||||
Gemfile.lock
|
||||
#Gemfile.lock
|
||||
InstalledFiles
|
||||
_yardoc
|
||||
coverage
|
||||
|
|
|
|||
Loading…
Reference in New Issue