caboose-cms 0.5.24 → 0.5.25
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/block.rb +3 -3
- data/app/models/caboose/category.rb +2 -2
- data/lib/caboose.rb +9 -0
- 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
|
+
MzJhYjVlMzc1MzgwNzk3MzUyYzc3NDMyZTQ1OGM5M2MwNTNmMWQ4Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDBmZThjYTNiODg4MDQ1N2EwZTQxYTQ4ODg3MTJiMjliODM3MmVhNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Yjg3ZmM2NTFkNDcwYzQ5YWQ3ZTFhMmFhNWU0NjcwZGY5ZjRjZmYxM2U4YmJj
|
10
|
+
YzRmYjYwZjQ1OWIzOTBlYjUyOWZhYTJiOTQxMTQyZTkzOGZmN2JkNGYwN2Uz
|
11
|
+
ODJiMjllNTEzNTllZTEwNjNkOTZmMDFlZDA2NWY3YzQyZDRmMTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmEyMDQzZDc0MjQ0YWM0NWYzMWI2NGZkYWVlMjE5M2ZmMjUyZGRiMmZhZDQy
|
14
|
+
MTExZTdiYmVlMjExOGNhN2M4YmQ0Y2NlYzUyMWNlODcyYjZkMmYzYTY3ZjRh
|
15
|
+
NDgxYWFjOWFjYmE4YWU5ZGZiMTZiZjE1YTNkZjMxMDA1NWJiMDM=
|
data/app/models/caboose/block.rb
CHANGED
@@ -8,10 +8,10 @@ class Caboose::Block < ActiveRecord::Base
|
|
8
8
|
belongs_to :block_type
|
9
9
|
belongs_to :parent, :foreign_key => 'parent_id', :class_name => 'Caboose::Block'
|
10
10
|
has_many :children, :foreign_key => 'parent_id', :class_name => 'Caboose::Block', :dependent => :delete_all, :order => 'sort_order'
|
11
|
-
has_attached_file :file, :
|
11
|
+
has_attached_file :file, :url => ':cdn_domain/uploads/:id.:extension'
|
12
12
|
do_not_validate_attachment_file_type :file
|
13
|
-
has_attached_file :image,
|
14
|
-
:
|
13
|
+
has_attached_file :image,
|
14
|
+
:url => ':cdn_domain/uploads/:id_:style.:extension',
|
15
15
|
:default_url => "http://placehold.it/300x300",
|
16
16
|
:styles => {
|
17
17
|
:tiny => '160x120>',
|
@@ -13,8 +13,8 @@ module Caboose
|
|
13
13
|
has_many :products, :through => :category_memberships, :order => 'title'
|
14
14
|
has_many :category_memberships
|
15
15
|
|
16
|
-
has_attached_file :image,
|
17
|
-
:
|
16
|
+
has_attached_file :image,
|
17
|
+
:url => ':cdn_domain/categories/:id_:style.:extension',
|
18
18
|
:default_url => 'http://placehold.it/300x300',
|
19
19
|
:s3_protocol => :https,
|
20
20
|
:styles => {
|
data/lib/caboose.rb
CHANGED
@@ -121,3 +121,12 @@ module Caboose
|
|
121
121
|
@@from_address = ''
|
122
122
|
|
123
123
|
end
|
124
|
+
|
125
|
+
Paperclip.interpolates :cdn_domain do |attachment, style|
|
126
|
+
return Caboose::cdn_domain == '/' ? '' : Caboose::cdn_domain
|
127
|
+
end
|
128
|
+
|
129
|
+
Paperclip.interpolates :path_without_cdn do |attachment, style|
|
130
|
+
x = Caboose::cdn_domain.nil? || Caboose::cdn_domain == '/' ? 1 : Caboose::cdn_domain.length
|
131
|
+
return attachment.url && attachment.url.length > 0 ? attachment.url[x..-1] : ''
|
132
|
+
end
|
data/lib/caboose/version.rb
CHANGED