caboose-cms 0.5.230 → 0.5.231
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/models/caboose/media.rb +4 -0
- data/lib/caboose/version.rb +1 -1
- data/lib/tasks/caboose.rake +8 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTM1NzEwNTE3MjkyZjdmMzU4NTk0Y2UwMDQzZmUyOTk0YThhODM4ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjBlYTgyMmMwMjNlMzBlYTliYTQ4NGFiMjc0YTJjZmU0NjI4YWY3OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDIzNDdlZTk3MzJiMWU3N2FjN2NiN2U3OTk1YzY0MGY2MDViN2VjYTg4ZTU1
|
10
|
+
NGI5NTEyNGUzNTg1MjdhNmU0NDc1ZDlhNzNhOGZjZjRiY2MzODcxYTY5Njlk
|
11
|
+
YmIxNjk0ZTliNTE2Yzc3Yzc1ZTZjNGIzMjFkZWY3ZmQ4ZjI0OWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODEyZDRlYzVkOWZkODg2NmY3ZmQ3Mzk2MzRhM2RiODRjMTk5ZjM4ZmQyNWI4
|
14
|
+
Yzk4ODY2ZDJiODc5YmU2OGVlNDAyZjZiNDViY2I2YWQxZWE5YWNhMzEyYWZj
|
15
|
+
NjJhMDEyZTg2YzFmYWFhZGM1MmUyYWYxMjAzMzE0NjQxN2MzZjA=
|
data/app/models/caboose/media.rb
CHANGED
@@ -96,5 +96,9 @@ class Caboose::Media < ActiveRecord::Base
|
|
96
96
|
return self.image.url(:original) if self.image && !self.image.url(:original).starts_with?('http://placehold.it')
|
97
97
|
return self.file.url
|
98
98
|
end
|
99
|
+
|
100
|
+
def reprocess_image
|
101
|
+
self.image.reprocess!
|
102
|
+
end
|
99
103
|
|
100
104
|
end
|
data/lib/caboose/version.rb
CHANGED
data/lib/tasks/caboose.rake
CHANGED
@@ -2,13 +2,16 @@ require "caboose/version"
|
|
2
2
|
|
3
3
|
namespace :caboose do
|
4
4
|
|
5
|
+
desc "Reprocess media images"
|
6
|
+
task :reprocess_media_images => :environment do
|
7
|
+
Caboose::Media.where("image_file_name is not null").reorder(:id).all.each do |m|
|
8
|
+
m.delay.reprocess_image
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
5
12
|
desc "Migrate block images to media"
|
6
13
|
task :migrate_block_images_to_media => :environment do
|
7
|
-
Caboose::Block.where("image_file_name is not null").reorder(:id).all.each do |b|
|
8
|
-
#next if b.page.nil?
|
9
|
-
#site_id = b.page.site_id
|
10
|
-
#next if site_id.nil?
|
11
|
-
#next if site_id == 1
|
14
|
+
Caboose::Block.where("image_file_name is not null and media_id is null").reorder(:id).all.each do |b|
|
12
15
|
b.delay.migrate_media
|
13
16
|
end
|
14
17
|
end
|