pulitzer 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 537956dacb256d813fb603394ddc5d5489ac02db
4
- data.tar.gz: eeb6ce69ab78ca92dea231636fcdcfa8a5c526cf
3
+ metadata.gz: 29b37bdeadc5d4a64fc567a5bc83d37c648c6166
4
+ data.tar.gz: 9123f6a96b2f9ef7ee83353de634fe151bfd49dd
5
5
  SHA512:
6
- metadata.gz: 5c2d1e8b54055d0d0e7fb7bff3677a1071afa014cbd2920c0ce3fd0d43365797db0058d4c353c845108c79a7f3bd1044ff89a08c5a0ca64cd1d28ac84db86e33
7
- data.tar.gz: 8d217ed2a200ee1e4e18e6c65a2db0c8534f9baa418a3659704cafd77310fd25a02565f1d108cdef246584f21e0185dea177a2e191363b07b618d398b2caab12
6
+ metadata.gz: 7c8e88a793d435457e437e6097fa2ff9a86e0a60739ea7073fa1c06b3ed5c5e14338c81b82215357c1157682e8c3c0651c53d6e84c622ccb601100b5661fbcfc
7
+ data.tar.gz: 625f4f249b09016f29c470e4f65e680a91baf5fa9dbfe14c1a22465983bfaf63520f277bea51e42efa71e5d19a48f730c85c4d7481242e3b570def3d24f5e8b8
@@ -9,13 +9,18 @@ class Pulitzer::UpdatePostTypeContentElements
9
9
 
10
10
  def call
11
11
  post_type.posts.each do |post|
12
- post.preview_version.content_elements.where(label: old_label).each do |content_element|
13
- content_element.update(label: ptcet.label,
14
- height: ptcet.height,
15
- width: ptcet.width,
16
- text_editor: ptcet.text_editor,
17
- content_element_type: ptcet.content_element_type,
18
- post_type_content_element_type: ptcet)
12
+ begin
13
+ preview_version = post.get_preview_version!
14
+ post.preview_version.content_elements.where(label: old_label).each do |content_element|
15
+ content_element.update(label: ptcet.label,
16
+ height: ptcet.height,
17
+ width: ptcet.width,
18
+ text_editor: ptcet.text_editor,
19
+ content_element_type: ptcet.content_element_type,
20
+ post_type_content_element_type: ptcet)
21
+ end
22
+ rescue Pulitzer::VersionAccessError
23
+ # if there is no preview version, skip this one.
19
24
  end
20
25
  end
21
26
  post_type.partials.each do |partial|
@@ -1,4 +1,5 @@
1
1
  module Pulitzer
2
- class VersionProcessingError < RuntimeError; end
3
- class VersionMissingError < RuntimeError; end
2
+ class VersionAccessError < RuntimeError; end
3
+ class VersionProcessingError < VersionAccessError; end
4
+ class VersionMissingError < VersionAccessError; end
4
5
  end
@@ -1,3 +1,3 @@
1
1
  module Pulitzer
2
- VERSION = '0.10.0'
2
+ VERSION = '0.10.1'
3
3
  end
Binary file