scrivito_pdf_widget 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f956f48f80e9325207531931b6dc57a17033e180
4
- data.tar.gz: 5965ff5c1b527dae0cd0d066b6c78dc07040b651
3
+ metadata.gz: b606644d5dfd3997c43c62cfa5af95add7d637a5
4
+ data.tar.gz: 02a697ba89dc0b76bc61f541f0eb1a7d9becbc70
5
5
  SHA512:
6
- metadata.gz: acfab0b41a40a4cdf79b468ce0de92103a6075f5d76a7989941f20479224b3e317e6d54db47b806ac6023f89944deb2b5e0a32acf2a1314abbf1658ca11a48bd
7
- data.tar.gz: b691a6cf796f04a65b9c391aed93e3acf4b2d2e469df427b2b22c95d76f9ac348f7ba23b40a5d8cfd3fc6a213439043e47064ee5ee27efd23567f06ad21fc25e
6
+ metadata.gz: 1cf73d8a560a22d33969fe2708b135b1d04fa15ecc22776cbb5f00f8c864cf599cfa2f9f9a4f8bc91265d30a7a2a5a1f47461ccf2beed6f7048c6b2f3172509b
7
+ data.tar.gz: a2b02c395233fe126a1ae54efd5c39fe802892d07968b6c07b65fbb4ddd71bdb5ad9c53207957e94fbee5c21ea74362c7a6aa29978907afa524e62308becb98d
data/app/models/pdf.rb CHANGED
@@ -1,25 +1,8 @@
1
- class Pdf < Scrivito::BasicObj
1
+ class Pdf < Obj
2
2
  attribute :headline, :string
3
3
  attribute :description, :html
4
4
  attribute :blob, :binary
5
5
 
6
- def self.create(attributes)
7
- attributes = attributes.with_indifferent_access
8
-
9
- unless attributes.has_key?(:_obj_class)
10
- attributes[:_obj_class] = 'Pdf'
11
- end
12
-
13
- if attributes.has_key?(:blob) && !attributes.has_key?(:_path)
14
- filename = Pathname.new(attributes[:blob].path).basename
15
- path = "_resources/#{SecureRandom.hex(8)}/#{filename}"
16
-
17
- attributes[:_path] = path
18
- end
19
-
20
- super(attributes)
21
- end
22
-
23
6
  def url_to_pdf
24
7
  self.try(:binary_url).split('?').first
25
8
  end
@@ -2,6 +2,6 @@ class PdfWidget < Widget
2
2
  attribute :pdf, :reference
3
3
 
4
4
  def self.filter
5
- {_obj_class: {field: '_obj_class', options: {images: {selected: true, title: 'Pdfs', value: 'Pdf'}}}}
5
+ {_obj_class: {field: '_obj_class', options: {images: {selected: true, title: 'PDFs', value: 'Pdf'}}}}
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module ScrivitoPdfWidget
2
- VERSION = "1.0.13"
2
+ VERSION = "1.0.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_pdf_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-15 00:00:00.000000000 Z
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler