caboose-cms 0.8.17 → 0.8.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13402536b1e5f9bcb3b178a2950b207f6d9bbdc0
4
- data.tar.gz: 704e6565a250acc6ae7d2e9d9e66b241adc52dfb
3
+ metadata.gz: e396ee4af10a9a46ddb79d556859276bbe27612b
4
+ data.tar.gz: 5929d71bc68d4f9e75ba97cbba9d598012833fc5
5
5
  SHA512:
6
- metadata.gz: 6e2aed02d6fc2a88bb431f800a65cc72a0309774a6cd3b5d4f168d3794acec29fda1d6ae3910581ba3ee333a6495f743e312f753e8b0b608993f32fee8cd5c49
7
- data.tar.gz: 4df248e0e08fdcfd627cef7af31b316e1e064dc2daffc804ed9c269cac3de5d5e8f2a4d638ec64d86c3163a1738ae5957eaa576c9463bee2b2638581be63982a
6
+ metadata.gz: b22e850aecc4ac1dd4011f166bf93ca255c27aaefa396dea708318dcbec8cb2b990cc4d077ce2f4735ac5897a72648669d9edc0e87aba884d359eb694d86599e
7
+ data.tar.gz: 0c978d67e9e5a6504762ccc285059fdae462b8c406a8b308c12b0dd4e48eea7a6f421863d595c48361c409bf82b287bc9aaf5022253b9be86a15da594af9dd44
@@ -133,7 +133,7 @@ module Caboose
133
133
  # Trigger the page cache to be updated
134
134
  query = ["update page_cache set refresh = true where page_id in (select distinct(page_id) from blocks where block_type_id = ?)", bt.id]
135
135
  ActiveRecord::Base.connection.execute(ActiveRecord::Base.send(:sanitize_sql_array, query))
136
- PageCacher.delay.refresh
136
+ PageCacher.delay(:queue => 'caboose_cache').refresh
137
137
 
138
138
  resp.success = save && bt.save
139
139
  render :json => resp
@@ -365,9 +365,9 @@ module Caboose
365
365
  if pc
366
366
  pc.refresh = true
367
367
  pc.save
368
- PageCacher.delay.refresh
368
+ PageCacher.delay(:queue => 'caboose_cache').refresh
369
369
  else
370
- PageCacher.delay.cache(b.page_id)
370
+ PageCacher.delay(:queue => 'caboose_cache').cache(b.page_id)
371
371
  end
372
372
  end
373
373
 
@@ -57,7 +57,7 @@ module Caboose
57
57
  :status => 'pending'
58
58
  )
59
59
  end
60
- GA.delay.event(@site.id, 'cart', 'add', "Product #{v.product.id}, Variant #{v.id}")
60
+ GA.delay(:queue => 'caboose_store').event(@site.id, 'cart', 'add', "Product #{v.product.id}, Variant #{v.id}")
61
61
  render :json => {
62
62
  :success => li.save,
63
63
  :errors => li.errors.full_messages,
@@ -146,7 +146,7 @@ module Caboose
146
146
 
147
147
  resp.success = true
148
148
  resp.invoice_total = @invoice.total
149
- GA.delay.event(@site.id, 'giftcard', 'add', "Giftcard #{gc.id}")
149
+ GA.delay(:queue => 'caboose_store').event(@site.id, 'giftcard', 'add', "Giftcard #{gc.id}")
150
150
  end
151
151
  render :json => resp
152
152
  end
@@ -233,7 +233,7 @@ module Caboose
233
233
  def admin_send_for_authorization
234
234
  return if !user_is_allowed('invoices', 'edit')
235
235
  invoice = Invoice.find(params[:id])
236
- invoice.delay.send_payment_authorization_email
236
+ invoice.delay(:queue => 'caboose_store').send_payment_authorization_email
237
237
  render :json => { :success => true }
238
238
  end
239
239
 
@@ -95,7 +95,7 @@ module Caboose
95
95
  when 'sort_order' then m.sort_order = value
96
96
  when 'image_url' then
97
97
  m.processed = false
98
- m.delay.download_image_from_url(value)
98
+ m.delay(:queue => 'caboose_media').download_image_from_url(value)
99
99
  end
100
100
  end
101
101
 
@@ -30,7 +30,7 @@ module Caboose
30
30
 
31
31
  m = Media.where(:media_category_id => media_category_id, :original_name => original_name, :name => name).first
32
32
  m = Media.create(:media_category_id => media_category_id, :original_name => original_name, :name => name, :processed => false) if m.nil?
33
- m.delay.process
33
+ m.delay(:queue => 'caboose_media').process
34
34
 
35
35
  end
36
36
  end
@@ -286,15 +286,15 @@ module Caboose
286
286
 
287
287
  when 'sale_price'
288
288
  v.sale_price = value
289
- v.product.delay(:run_at => 3.seconds.from_now).update_on_sale
289
+ v.product.delay(:run_at => 3.seconds.from_now, :queue => 'caboose_store').update_on_sale
290
290
  when 'date_sale_starts'
291
291
  v.date_sale_starts = ModelBinder.local_datetime_to_utc(value, @logged_in_user.timezone)
292
- v.product.delay(:run_at => v.date_sale_starts).update_on_sale
293
- v.product.delay(:run_at => 3.seconds.from_now).update_on_sale
292
+ v.product.delay(:run_at => v.date_sale_starts, :queue => 'caboose_store').update_on_sale
293
+ v.product.delay(:run_at => 3.seconds.from_now, :queue => 'caboose_store').update_on_sale
294
294
  when 'date_sale_ends'
295
295
  v.date_sale_ends = ModelBinder.local_datetime_to_utc(value, @logged_in_user.timezone)
296
- v.product.delay(:run_at => v.date_sale_ends).update_on_sale
297
- v.product.delay(:run_at => 3.seconds.from_now).update_on_sale
296
+ v.product.delay(:run_at => v.date_sale_ends , :queue => 'caboose_store').update_on_sale
297
+ v.product.delay(:run_at => 3.seconds.from_now, :queue => 'caboose_store').update_on_sale
298
298
  end
299
299
  end
300
300
  resp.success = save && v.save
@@ -444,38 +444,38 @@ module Caboose
444
444
  when 'sale_price'
445
445
  variants.each_with_index do |v, i|
446
446
  v.sale_price = value
447
- v.product.delay(:run_at => 3.seconds.from_now).update_on_sale if i == 0
447
+ v.product.delay(:run_at => 3.seconds.from_now, :queue => 'caboose_store').update_on_sale if i == 0
448
448
  end
449
449
  when 'date_sale_starts'
450
450
  variants.each_with_index do |v, i|
451
451
  v.date_sale_starts = ModelBinder.update_date(v.date_sale_starts, value, @logged_in_user.timezone)
452
452
  if i == 0
453
- v.product.delay(:run_at => v.date_sale_starts).update_on_sale
454
- v.product.delay(:run_at => 3.seconds.from_now).update_on_sale
453
+ v.product.delay(:run_at => v.date_sale_starts, :queue => 'caboose_store').update_on_sale
454
+ v.product.delay(:run_at => 3.seconds.from_now, :queue => 'caboose_store').update_on_sale
455
455
  end
456
456
  end
457
457
  when 'time_sale_starts'
458
458
  variants.each_with_index do |v, i|
459
459
  v.date_sale_starts = ModelBinder.update_time(v.date_sale_starts, value, @logged_in_user.timezone)
460
460
  if i == 0
461
- v.product.delay(:run_at => v.date_sale_starts).update_on_sale
462
- v.product.delay(:run_at => 3.seconds.from_now).update_on_sale
461
+ v.product.delay(:run_at => v.date_sale_starts, :queue => 'caboose_store').update_on_sale
462
+ v.product.delay(:run_at => 3.seconds.from_now, :queue => 'caboose_store').update_on_sale
463
463
  end
464
464
  end
465
465
  when 'date_sale_ends'
466
466
  variants.each_with_index do |v, i|
467
467
  v.date_sale_ends = ModelBinder.update_date(v.date_sale_ends, value, @logged_in_user.timezone)
468
468
  if i == 0
469
- v.product.delay(:run_at => v.date_sale_ends).update_on_sale
470
- v.product.delay(:run_at => 3.seconds.from_now).update_on_sale
469
+ v.product.delay(:run_at => v.date_sale_ends , :queue => 'caboose_store').update_on_sale
470
+ v.product.delay(:run_at => 3.seconds.from_now, :queue => 'caboose_store').update_on_sale
471
471
  end
472
472
  end
473
473
  when 'time_sale_ends'
474
474
  variants.each_with_index do |v, i|
475
475
  v.date_sale_ends = ModelBinder.update_time(v.date_sale_ends, value, @logged_in_user.timezone)
476
476
  if i == 0
477
- v.product.delay(:run_at => v.date_sale_ends).update_on_sale
478
- v.product.delay(:run_at => 3.seconds.from_now).update_on_sale
477
+ v.product.delay(:run_at => v.date_sale_ends , :queue => 'caboose_store').update_on_sale
478
+ v.product.delay(:run_at => 3.seconds.from_now, :queue => 'caboose_store').update_on_sale
479
479
  end
480
480
  end
481
481
 
@@ -183,8 +183,8 @@ class Caboose::Media < ActiveRecord::Base
183
183
  :file_updated_at => self.file_updated_at ,
184
184
  :processed => false
185
185
  )
186
- m.delay.download_image_from_url(self.image.url(:original)) if self.image
187
- m.delay.download_file_from_url(self.file.url) if self.file
186
+ m.delay(:queue => 'caboose_media').download_image_from_url(self.image.url(:original)) if self.image
187
+ m.delay(:queue => 'caboose_media').download_file_from_url(self.file.url) if self.file
188
188
  return m
189
189
  end
190
190
 
@@ -4,14 +4,14 @@ module Caboose
4
4
 
5
5
  def self.refresh
6
6
  PageCache.where(:refresh => true).all.each do |pc|
7
- self.delay.cache(pc.page_id)
7
+ self.delay(:queue => 'caboose_cache').cache(pc.page_id)
8
8
  end
9
9
 
10
10
  # Make sure all pages are cached
11
11
  query = ["select id from pages where id not in (select distinct(page_id) from page_cache)"]
12
12
  rows = ActiveRecord::Base.connection.execute(ActiveRecord::Base.send(:sanitize_sql_array, query))
13
13
  if rows
14
- rows.each{ |row| self.delay.cache(row['id'].to_i) }
14
+ rows.each{ |row| self.delay(:queue => 'caboose_cache').cache(row['id'].to_i) }
15
15
  end
16
16
  end
17
17
 
@@ -19,7 +19,7 @@ module Caboose
19
19
  query = ["select id from pages order by id"]
20
20
  rows = ActiveRecord::Base.connection.execute(ActiveRecord::Base.send(:sanitize_sql_array, query))
21
21
  if rows
22
- rows.each{ |row| self.delay.cache(row['id'].to_i) }
22
+ rows.each{ |row| self.delay(:queue => 'caboose_cache').cache(row['id'].to_i) }
23
23
  end
24
24
  end
25
25
 
@@ -218,7 +218,7 @@ module Caboose
218
218
 
219
219
  def Product.update_on_sale
220
220
  Product.reorder(:id).all.each do |p|
221
- p.delay.update_on_sale
221
+ p.delay(:queue => 'caboose_store').update_on_sale
222
222
  end
223
223
  end
224
224
 
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.8.17'
2
+ VERSION = '0.8.18'
3
3
  end
@@ -249,17 +249,17 @@ namespace :caboose do
249
249
  desc "Reprocess media images"
250
250
  task :reprocess_media_images => :environment do
251
251
  Caboose::Media.where("image_file_name is not null").reorder(:id).all.each do |m|
252
- m.delay.reprocess_image
252
+ m.delay(:queue => 'caboose_media').reprocess_image
253
253
  end
254
254
  end
255
255
 
256
256
  desc "Migrate block images and files to media"
257
257
  task :migrate_block_assets_to_media => :environment do
258
258
  Caboose::Block.where("image_file_name is not null and media_id is null").reorder(:id).all.each do |b|
259
- b.delay.migrate_media
259
+ b.delay(:queue => 'caboose_media').migrate_media
260
260
  end
261
261
  Caboose::Block.where("file_file_name is not null and media_id is null").reorder(:id).all.each do |b|
262
- b.delay.migrate_media
262
+ b.delay(:queue => 'caboose_media').migrate_media
263
263
  end
264
264
  Caboose::BlockType.where(:id => 19).update_all('name' => 'image2')
265
265
  Caboose::Block.where(:block_type_id => 19).update_all('name' => 'image2')
@@ -267,12 +267,12 @@ namespace :caboose do
267
267
 
268
268
  desc "Update expired caches and cache pages that aren't cached"
269
269
  task :cache_pages => :environment do
270
- Caboose::PageCacher.delay.refresh
270
+ Caboose::PageCacher.delay(:queue => 'caboose_cache').refresh
271
271
  end
272
272
 
273
273
  desc "Cache all pages"
274
274
  task :cache_all_pages => :environment do
275
- Caboose::PageCacher.delay.cache_all
275
+ Caboose::PageCacher.delay(:queue => 'caboose_cache').cache_all
276
276
  end
277
277
 
278
278
  desc "Run rspec tests on Caboose"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.17
4
+ version: 0.8.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-12 00:00:00.000000000 Z
11
+ date: 2016-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg