pulitzer 0.15.18 → 0.15.19

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: 82a1f811f058a012d5c2cac04500ca7b502a1e15
4
- data.tar.gz: a077b28271d678891d4657e3c3b340a828dcb515
3
+ metadata.gz: 8351c9d32ad098ca8aaf6ada32f95ec82e7f76b9
4
+ data.tar.gz: 6007e6cdb4db72d84fb6849c510b25da12424b2c
5
5
  SHA512:
6
- metadata.gz: 5c190e25def952928a749cf77c4947833dd5b4d66b36e3f97ed57acfb0b8864978c463f9c197e4cfe9d2057f4b7b2abb37c279a435af6e56592f7b39d764e063
7
- data.tar.gz: cdfef5dcd0fa2d2d34c7eac132db5b0042b83eb9863d388db434162de5deacab089f77ad4e4a4ba0324a5e2c083eb0b63b4d9e7709a665f01a3448a2cb3edb74
6
+ metadata.gz: 61de067fc0373233a319954abd196e362771416bb27f7ca39df22aadd3f978ddda8e7b1b750ffbc9ef1a74cf0b63791b985dbf8dd20a9918b894c968851ca041
7
+ data.tar.gz: 59e71dfb8a6110559df1a0ed3da38b8238c0fe1d21064e7efed4bcc9532b8cabcab5b3e1eafd6a3f03b552266aeba0fd2f917a3b4dd88da6cf5af29d21aabaee
@@ -6,7 +6,7 @@ module Pulitzer
6
6
  has_one :active_version, -> { where(status: 'active') }, class_name: "Pulitzer::Version"
7
7
 
8
8
  accepts_nested_attributes_for :versions
9
-
9
+
10
10
  belongs_to :post_type_version
11
11
  delegate :post_type_content_element_types, :free_form_section_types, :has_free_form_sections?, :has_templated_content_elements?, :post_type, :post_type_id, :plural?, to: :post_type_version
12
12
  delegate :post_tags, :content_elements, :content_element, :section, :has_label_type, :has_label, :post_tags_for, to: :active_version, allow_nil: true
@@ -28,7 +28,7 @@ module Pulitzer
28
28
  }
29
29
  }
30
30
  end
31
-
31
+
32
32
  def self.convert_nested_assoc(json_hash)
33
33
  this_array = json_hash.has_key?(attrs_name) ? json_hash[attrs_name] : [json_hash]
34
34
  this_array.map!{|p_attrs|
@@ -73,16 +73,12 @@ module Pulitzer
73
73
 
74
74
  def render_cms_section(version, section_name)
75
75
  section = version.section(section_name)
76
- if section
77
- section.partials.collect do |partial|
78
- if partial.has_display?
79
- render partial: partial.full_view_path, locals: {partial: partial}
80
- end
81
- end.join.html_safe
82
- else
83
- Rails.logger.error "[Pulitzer] Version #{version.inspect} has no section named #{section_name}"
84
- ""
85
- end
76
+ fail SectionMissingError.new("Version #{version.inspect} is missing a section called '#{section_name}' but it's trying to render it.") unless section
77
+ section.partials.collect do |partial|
78
+ if partial.has_display?
79
+ render partial: partial.full_view_path, locals: {partial: partial}
80
+ end
81
+ end.join.html_safe
86
82
  end
87
83
  end
88
84
  end
@@ -2,4 +2,5 @@ module Pulitzer
2
2
  class VersionAccessError < RuntimeError; end
3
3
  class VersionProcessingError < VersionAccessError; end
4
4
  class VersionMissingError < VersionAccessError; end
5
- end
5
+ class SectionMissingError < RuntimeError; end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module Pulitzer
2
- VERSION = '0.15.18'
2
+ VERSION = '0.15.19'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pulitzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.18
4
+ version: 0.15.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-13 00:00:00.000000000 Z
12
+ date: 2017-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails