polyblock 0.8.0 → 0.8.1
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 +4 -4
- data/app/models/polyblock/block.rb +3 -4
- data/lib/polyblock/version.rb +1 -1
- data/lib/polyblock/view_helpers.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c0b2a91024ad5e1bb738464dfba70f5f86eab39
|
|
4
|
+
data.tar.gz: c355af45e8d74a354c23264c647889c7f8540cc0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4eea0556cae530fc6c0d2f5bf7b3289e6615f3759b73e57408f9d18d8d403d5b157a41176e5a69b8dea9853864a8799c51764c1d32bc6a3ae804e7f93aa29d2e
|
|
7
|
+
data.tar.gz: 756dad9394f0a238bddbca849b9f31675d4d8508ca8e338e7ed0473f18767d67b19c38fba501d87f3ce3609c5be4f566574b67199bd8eaa4075c2c0689df2b06
|
|
@@ -3,10 +3,6 @@ require 'json'
|
|
|
3
3
|
module Polyblock
|
|
4
4
|
class Block < ActiveRecord::Base
|
|
5
5
|
attr_accessor :settings
|
|
6
|
-
belongs_to :contentable, :polymorphic => true
|
|
7
|
-
|
|
8
|
-
before_save :strip_html_if_necessary
|
|
9
|
-
|
|
10
6
|
DEFAULTS = {
|
|
11
7
|
:association => {
|
|
12
8
|
:class_name => "Polyblock::Block",
|
|
@@ -19,6 +15,9 @@ module Polyblock
|
|
|
19
15
|
:default_text => "[Editable content space for Polyblock <code>#{name}</code>]"
|
|
20
16
|
}
|
|
21
17
|
|
|
18
|
+
belongs_to :contentable, :polymorphic => true
|
|
19
|
+
before_save :strip_html_if_necessary
|
|
20
|
+
|
|
22
21
|
def self.import(pbs)
|
|
23
22
|
outputs = pbs.map do |pb|
|
|
24
23
|
block = fetch_or_initialize pb[:name]
|
data/lib/polyblock/version.rb
CHANGED
|
@@ -18,7 +18,7 @@ module Polyblock
|
|
|
18
18
|
random_id = Block.random_id
|
|
19
19
|
|
|
20
20
|
# Build output tag
|
|
21
|
-
content = pb.content.present? ? pb.content : pb.settings
|
|
21
|
+
content = pb.content.present? ? pb.content : pb.settings[:default_text]
|
|
22
22
|
tag_options = options[:tag_options].deep_merge({:id => "pb-#{pb_id}-#{random_id}", :data => {:pbid => pb_id, :pbname => name}})
|
|
23
23
|
tag_options[:contenteditable] = if options[:condensed]
|
|
24
24
|
'false'
|
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: 0.8.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- MacKinley Smith
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-08-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|