polyblock 1.0.4 → 1.0.5

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: f6afa1c2c774ca02b2e4c2b29242da62a51384c1
4
- data.tar.gz: c0fc87f15157b5ae7faff4eaca74377fc90a3f02
3
+ metadata.gz: 920f822fd193d80be7b5b15833339cd40e27deaf
4
+ data.tar.gz: 08a9857ae2e472dbf92ee1f2791c1465a9375222
5
5
  SHA512:
6
- metadata.gz: ee1511aa1dd76ecdf12fa6df8306f3837b458997fc9bc09db6f0839845155bc96a8c462c056bd13f6a19f6e18507a3c5d278b59bfd23c9a4ee49e2698c86862d
7
- data.tar.gz: 879d0d89d3d569fad68e39005cf78d9b68bb198b32a8817b75e12069e18c1e2223fadb0e7ca2b353562066342f7605eb4e8203d877f94884ec9b5f7c56c34c88
6
+ metadata.gz: 7fa2f133a6b785071e22f5bd7dc5c7593d29cb0c095f1eb2a44c38fbe5845118296b2d88677da570e42aabc310ee806af1421c69aea379ff54f28624aa402c89
7
+ data.tar.gz: 94c81270f55be296de7c54772e9b03c9ba7e3fccc75f3c24731fa1d59ed90b8c7cea5af106e27aa21b013be5c4a2d2e6d669a19d87e21d377621fce617552539
@@ -41,7 +41,9 @@ module Polyblock
41
41
  self.settings_cache = self.contentable.present? ? self.contentable.send("#{self.name}_settings") : DEFAULTS
42
42
  end
43
43
 
44
- def to_s; self.class.strip_html self.content end
44
+ def to_s
45
+ return nil if self.content.nil?
46
+ self.class.strip_html(self.content) end
45
47
 
46
48
  def present?
47
49
  !nil? && content.present?
@@ -82,6 +84,7 @@ module Polyblock
82
84
  end
83
85
 
84
86
  def self.strip_html(str)
87
+ return str unless str.present?
85
88
  output = str.gsub('<br><br>', '<br>').gsub('&nbsp;', ' ')
86
89
  output = CGI.unescapeHTML(output)
87
90
  output = ActionController::Base.helpers.strip_tags(output)
@@ -1,3 +1,3 @@
1
1
  module Polyblock
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyblock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - MacKinley Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-28 00:00:00.000000000 Z
11
+ date: 2015-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails