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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWZjNzQwNTBmMzQ5YzA2ZjIzMzJkODhjODY0MWIxZjU0OWViMTA0ZA==
4
+ MzJhYjVlMzc1MzgwNzk3MzUyYzc3NDMyZTQ1OGM5M2MwNTNmMWQ4Ng==
5
5
  data.tar.gz: !binary |-
6
- YjE2ZTA2YzBlNDM3OTY1M2RlYjI3ZmNlNGY5NjU1OTJiMmU5ZjYyNg==
6
+ MDBmZThjYTNiODg4MDQ1N2EwZTQxYTQ4ODg3MTJiMjliODM3MmVhNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzI2NzAwZGQwOWRhYjZiMjZkZTA4MDAxOGYzYTYzZmU4OWRkYjZlYzQzOTll
10
- NzQzMWU2MzA2NTdlNzY2NzQ3ZmIwZGE5NmNiZjRlMGMwYzRkZTY1OWRiYmI1
11
- OTZjYjdhN2ZhMWU2ZTA0NDg3ZDUzZDM5ZTFjMzU4NDQ4MjIxYzY=
9
+ Yjg3ZmM2NTFkNDcwYzQ5YWQ3ZTFhMmFhNWU0NjcwZGY5ZjRjZmYxM2U4YmJj
10
+ YzRmYjYwZjQ1OWIzOTBlYjUyOWZhYTJiOTQxMTQyZTkzOGZmN2JkNGYwN2Uz
11
+ ODJiMjllNTEzNTllZTEwNjNkOTZmMDFlZDA2NWY3YzQyZDRmMTk=
12
12
  data.tar.gz: !binary |-
13
- ZWRiMDIzYTkwYzUyMjZjNGY4MjY5YjE2Yjk2NmRhMWNlZGQ2MTg2MzM3OGRj
14
- OTUwMTViYjI3MGM1YzIwYTdiZDU3Y2VkNTFkMjllMjkyODAyOWYwNDkxODkz
15
- ZWJjNzU4ZDZjYzkwM2ZiNzliZDg4ZWI4OTkxNjgzZjJlZGM5NjY=
13
+ MmEyMDQzZDc0MjQ0YWM0NWYzMWI2NGZkYWVlMjE5M2ZmMjUyZGRiMmZhZDQy
14
+ MTExZTdiYmVlMjExOGNhN2M4YmQ0Y2NlYzUyMWNlODcyYjZkMmYzYTY3ZjRh
15
+ NDgxYWFjOWFjYmE4YWU5ZGZiMTZiZjE1YTNkZjMxMDA1NWJiMDM=
@@ -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, :path => 'uploads/:id.:extension'
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
- :path => 'uploads/:id_:style.:extension',
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
- :path => 'categories/:id_:style.:extension',
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
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.24'
2
+ VERSION = '0.5.25'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.24
4
+ version: 0.5.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry