caboose-cms 0.6.15 → 0.6.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/controllers/caboose/#Untitled-1# +1 -0
- data/app/models/caboose/media.rb +5 -7
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjI1YjFlNmY3MmZkYWIzMTJlNGFmZjVhZjJjMDk5OTE0ZjUyMWI0YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTQyNjIxZTRlZWQ0MTFiOTJkYjU0MDZmZGZhMzYxNmJhNWFiZDM1NQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGZhNTk2ZmM1YWNjZmRiNjhjYTIzMjUyNDFkNWFiODcxZjU4YTNmOGJiNTdm
|
10
|
+
OGJmZmIzMzllOWZiZGNkYmRmZmQ1NWM4OGFhZTNiN2EzNTFiOGM4OWY0Nzcw
|
11
|
+
Y2NiNmMyZjM4NzVhZDZiNThjMjM1MDg3ZTM1MTJhZGM2MGViZmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWQyZDRlMGU4ZTJlNTM5NGQ0YjRkZWZiM2ZhZTIzNzE1MTQwODgyMzNjYmNh
|
14
|
+
MzgzNGNkN2YwNThmNDVlNTMwMTI5ZDVhMDQyYTllZjU5YWZhYWU1NzU1Yjc5
|
15
|
+
YjdlMDVhMzc0NjhjNDJmM2EyZTk4ZGVjMzE5MzNiZWNmYzY5OGQ=
|
data/app/models/caboose/media.rb
CHANGED
@@ -37,13 +37,11 @@ class Caboose::Media < ActiveRecord::Base
|
|
37
37
|
|
38
38
|
config = YAML.load(File.read(Rails.root.join('config', 'aws.yml')))[Rails.env]
|
39
39
|
bucket = config['bucket']
|
40
|
+
bucket = Caboose::uploads_bucket && Caboose::uploads_bucket.strip.length > 0 ? Caboose::uploads_bucket : "#{bucket}-uploads"
|
40
41
|
|
41
|
-
key = "#{self.media_category_id}_#{self.original_name}"
|
42
|
-
|
43
|
-
|
44
|
-
Caboose.log("key after encoding: #{key}")
|
45
|
-
uri = "http://#{bucket}-uploads.s3.amazonaws.com/#{key}"
|
46
|
-
Caboose.log("uri: #{uri}")
|
42
|
+
key = "#{self.media_category_id}_#{self.original_name}"
|
43
|
+
key = URI.encode(key.gsub(' ', '+'))
|
44
|
+
uri = "http://#{bucket}.s3.amazonaws.com/#{key}"
|
47
45
|
|
48
46
|
image_extensions = ['.jpg', '.jpeg', '.gif', '.png', '.tif']
|
49
47
|
ext = File.extname(key).downcase
|
@@ -64,7 +62,7 @@ class Caboose::Media < ActiveRecord::Base
|
|
64
62
|
#end
|
65
63
|
|
66
64
|
# Remove the temp file
|
67
|
-
bucket = AWS::S3::Bucket.new(
|
65
|
+
bucket = AWS::S3::Bucket.new(bucket)
|
68
66
|
obj = bucket.objects[key]
|
69
67
|
obj.delete
|
70
68
|
|
data/lib/caboose/version.rb
CHANGED