polyblock 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/polyblock/block.rb +28 -1
- data/lib/generators/polyblock/install/install_generator.rb +1 -0
- data/lib/polyblock/glue.rb +9 -0
- data/lib/polyblock/has_polyblock.rb +28 -3
- data/lib/polyblock/railtie.rb +17 -0
- data/lib/polyblock/validators/polyblock_presence_validator.rb +26 -0
- data/lib/polyblock/validators.rb +37 -0
- data/lib/polyblock/version.rb +1 -1
- data/lib/polyblock/view_helpers.rb +2 -3
- data/test/dummy/app/models/event.rb +2 -1
- data/test/dummy/config/routes.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/development.log +121 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0fb6298e64061cd2c8bbebc406534db1ec825f2
|
4
|
+
data.tar.gz: f0732510ca23e09e814814d91f8afa9059bb864c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a5ec3f86b480599dda3cc90b633f3de05c58b8e7cedb498e82063a01c5ab1ae16358baf0e9691b51714b64ec875dd9c0e246ab565bab207920c45eed7f4be18
|
7
|
+
data.tar.gz: 41f74a239a3f7c6c7ace39a64b2a44b4250bf9c87b1ccce0b73cf77763e7bfaa12c79381862201dff2f08d747893a182be4c22455a54c9e7192d0bde23820f23
|
@@ -2,9 +2,23 @@ require 'json'
|
|
2
2
|
|
3
3
|
module Polyblock
|
4
4
|
class Block < ActiveRecord::Base
|
5
|
-
|
5
|
+
attr_accessor :settings
|
6
6
|
belongs_to :contentable, :polymorphic => true
|
7
7
|
|
8
|
+
before_save :strip_html_if_necessary
|
9
|
+
|
10
|
+
DEFAULTS = {
|
11
|
+
:association => {
|
12
|
+
:class_name => "Polyblock::Block",
|
13
|
+
:as => :contentable,
|
14
|
+
:dependent => :destroy
|
15
|
+
},
|
16
|
+
:nested_attributes => {},
|
17
|
+
:validates => {},
|
18
|
+
:html => true,
|
19
|
+
:default_text => "[Editable content space for Polyblock <code>#{name}</code>]"
|
20
|
+
}
|
21
|
+
|
8
22
|
def self.import(pbs)
|
9
23
|
outputs = pbs.map do |pb|
|
10
24
|
block = fetch_or_initialize pb[:name]
|
@@ -65,5 +79,18 @@ module Polyblock
|
|
65
79
|
(0...50).map { o[rand(o.length)] }.join
|
66
80
|
end
|
67
81
|
|
82
|
+
def self.strip_html(str)
|
83
|
+
output = str.gsub('<br><br>', '<br>').gsub(' ', ' ')
|
84
|
+
output = CGI.unescapeHTML(output)
|
85
|
+
output = ActionController::Base.helpers.strip_tags(output)
|
86
|
+
output.html_safe
|
87
|
+
end
|
88
|
+
|
89
|
+
private
|
90
|
+
def strip_html_if_necessary
|
91
|
+
self.settings ||= self.contentable.send(self.name).settings
|
92
|
+
self.content = Block.strip_html(self.content) unless self.settings[:html] || self.content.nil?
|
93
|
+
end
|
94
|
+
|
68
95
|
end
|
69
96
|
end
|
@@ -7,17 +7,42 @@ module Polyblock
|
|
7
7
|
|
8
8
|
module ClassMethods
|
9
9
|
def has_polyblock(name, options={})
|
10
|
-
defaults =
|
11
|
-
|
12
|
-
|
10
|
+
defaults = Polyblock::Block::DEFAULTS
|
11
|
+
settings = defaults.deep_merge(options)
|
12
|
+
has_one name, -> { where(:name => name) }, settings[:association]
|
13
|
+
accepts_nested_attributes_for name, settings[:nested_attributes]
|
14
|
+
after_initialize do
|
15
|
+
send("build_#{name}".to_sym) if send(name.to_sym).nil?
|
16
|
+
send(name.to_sym).settings = settings
|
17
|
+
end
|
13
18
|
include Polyblock::HasPolyblock::LocalInstanceMethods
|
14
19
|
end
|
20
|
+
|
21
|
+
def polyblocks
|
22
|
+
Polyblock::Block.select('polyblock_blocks.name')
|
23
|
+
.where(:contentable_type => self.name)
|
24
|
+
.group('polyblock_blocks.name')
|
25
|
+
.map(&:name)
|
26
|
+
end
|
27
|
+
def has_polyblock?(name)
|
28
|
+
self.polyblocks.include?(name)
|
29
|
+
end
|
15
30
|
end
|
16
31
|
|
17
32
|
module LocalInstanceMethods
|
18
33
|
def has_polyblock_content_for?(name)
|
19
34
|
!self.send(name).nil? and !self.send(name).content.blank?
|
20
35
|
end
|
36
|
+
|
37
|
+
def polyblocks
|
38
|
+
Polyblock::Block.select('polyblock_blocks.name')
|
39
|
+
.where(:contentable => self)
|
40
|
+
.group('polyblock_blocks.name')
|
41
|
+
.map(&:name)
|
42
|
+
end
|
43
|
+
def has_polyblock?(name)
|
44
|
+
polyblocks.include?(name)
|
45
|
+
end
|
21
46
|
end
|
22
47
|
end
|
23
48
|
end
|
data/lib/polyblock/railtie.rb
CHANGED
@@ -1,8 +1,25 @@
|
|
1
1
|
require 'polyblock/view_helpers'
|
2
|
+
require 'polyblock/glue'
|
3
|
+
|
2
4
|
module Polyblock
|
5
|
+
require 'rails'
|
6
|
+
|
3
7
|
class Railtie < Rails::Railtie
|
8
|
+
initializer "polyblock.insert_into_active_record" do |app|
|
9
|
+
ActiveSupport.on_load :active_record do
|
10
|
+
Polyblock::Railtie.insert
|
11
|
+
end
|
12
|
+
end
|
4
13
|
initializer "polyblock.view_helpers" do
|
5
14
|
ActionView::Base.send :include, ViewHelpers
|
6
15
|
end
|
7
16
|
end
|
17
|
+
|
18
|
+
class Railtie
|
19
|
+
def self.insert
|
20
|
+
if defined?(ActiveRecord)
|
21
|
+
ActiveRecord::Base.send(:include, Polyblock::Glue)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
8
25
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'active_model/validations/presence'
|
2
|
+
|
3
|
+
module Polyblock
|
4
|
+
module Validators
|
5
|
+
class PolyblockPresenceValidator < ActiveModel::EachValidator
|
6
|
+
|
7
|
+
def validate_each(record, attribute, value)
|
8
|
+
unless record.send(attribute).present?
|
9
|
+
record.errors.add(attribute, :blank, options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.helper_method_name
|
14
|
+
:validates_polyblock_presence
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
module HelperMethods
|
20
|
+
def validates_polyblock_presence(*attr_names)
|
21
|
+
options = _merge_attributes(attr_names)
|
22
|
+
validates_with PolyblockPresenceValidator, options.dup
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'active_model'
|
2
|
+
require 'active_support/concern'
|
3
|
+
require 'active_support/core_ext/array/wrap'
|
4
|
+
require 'polyblock/validators/polyblock_presence_validator'
|
5
|
+
|
6
|
+
module Polyblock
|
7
|
+
module Validators
|
8
|
+
extend ActiveSupport::Concern
|
9
|
+
|
10
|
+
included do
|
11
|
+
extend HelperMethods
|
12
|
+
include HelperMethods
|
13
|
+
end
|
14
|
+
|
15
|
+
module ClassMethods
|
16
|
+
def validates_polyblock(*attributes)
|
17
|
+
options = attributes.extract_options!.dup
|
18
|
+
|
19
|
+
Polyblock::Validators.constants.each do |constant|
|
20
|
+
if constant.to_s =~ /\APolyblock(.+)Validator\Z/
|
21
|
+
validator_kind = $1.underscore.to_sym
|
22
|
+
|
23
|
+
if options.has_key?(validator_kind)
|
24
|
+
validator_options = options.delete(validator_kind)
|
25
|
+
validator_options = {} if validator_options == true
|
26
|
+
conditional_options = options.slice(:if, :unless)
|
27
|
+
Array.wrap(validator_options).each do |local_options|
|
28
|
+
method_name = Polyblock::Validators.const_get(constant.to_s).helper_method_name
|
29
|
+
send(method_name, attributes, local_options.merge(conditional_options))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
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 :
|
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'
|
@@ -46,8 +46,7 @@ module Polyblock
|
|
46
46
|
# Truncation
|
47
47
|
if options[:condensed]
|
48
48
|
tag_options[:class] += " polyblock-condensed"
|
49
|
-
|
50
|
-
truncate(sanitize(strip_tags(content)), :length => options[:length], :omission => options[:omission])
|
49
|
+
truncate(Block.strip_html(content), :length => options[:length], :omission => options[:omission])
|
51
50
|
else
|
52
51
|
content_tag(options[:tag], content, tag_options, false)
|
53
52
|
end
|
data/test/dummy/config/routes.rb
CHANGED
Binary file
|
@@ -74037,3 +74037,124 @@ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-07-16 15:28:31
|
|
74037
74037
|
|
74038
74038
|
|
74039
74039
|
Started GET "/assets/ckeditor/lang/en.js" for 127.0.0.1 at 2014-07-16 15:28:31 -0400
|
74040
|
+
[1m[36mPolyblock::Block Load (24.6ms)[0m [1mSELECT "polyblock_blocks".* FROM "polyblock_blocks" ORDER BY "polyblock_blocks"."id" DESC LIMIT 1[0m
|
74041
|
+
[1m[35mPolyblock::Block Load (0.2ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" ORDER BY "polyblock_blocks"."id" DESC LIMIT 1
|
74042
|
+
[1m[36mEvent Load (0.4ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1[0m
|
74043
|
+
[1m[35m (0.1ms)[0m begin transaction
|
74044
|
+
[1m[36mSQL (60.1ms)[0m [1mINSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Sun, 27 Jul 2014 19:21:33 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 19:21:33 UTC +00:00]]
|
74045
|
+
[1m[35mSQL (14.4ms)[0m INSERT INTO "polyblock_blocks" ("contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["contentable_id", 1], ["contentable_type", "Event"], ["created_at", Sun, 27 Jul 2014 19:21:33 UTC +00:00], ["name", :description], ["updated_at", Sun, 27 Jul 2014 19:21:33 UTC +00:00]]
|
74046
|
+
[1m[36m (2.1ms)[0m [1mcommit transaction[0m
|
74047
|
+
[1m[35mEvent Load (0.4ms)[0m SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
|
74048
|
+
[1m[36mPolyblock::Block Load (39.9ms)[0m [1mSELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1[0m [["contentable_id", 1], ["contentable_type", "Event"]]
|
74049
|
+
[1m[36mEvent Load (17.7ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1[0m
|
74050
|
+
[1m[35mPolyblock::Block Load (48.0ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 1], ["contentable_type", "Event"]]
|
74051
|
+
[1m[36mEvent Load (17.9ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1[0m
|
74052
|
+
[1m[35mPolyblock::Block Load (14.9ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 1], ["contentable_type", "Event"]]
|
74053
|
+
[1m[36mEvent Load (0.5ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1[0m
|
74054
|
+
[1m[35mPolyblock::Block Load (82.2ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 1], ["contentable_type", "Event"]]
|
74055
|
+
[1m[36mEvent Load (18.4ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1[0m
|
74056
|
+
[1m[35mPolyblock::Block Load (36.6ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 1], ["contentable_type", "Event"]]
|
74057
|
+
[1m[36mEvent Load (0.2ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1[0m
|
74058
|
+
[1m[35mPolyblock::Block Load (0.2ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 1], ["contentable_type", "Event"]]
|
74059
|
+
[1m[36mEvent Load (0.2ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1[0m
|
74060
|
+
[1m[35mPolyblock::Block Load (0.2ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 1], ["contentable_type", "Event"]]
|
74061
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
74062
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
74063
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
74064
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
74065
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
74066
|
+
[1m[35mSQL (85.2ms)[0m INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 27 Jul 2014 19:58:18 UTC +00:00], ["title", "Test!"], ["updated_at", Sun, 27 Jul 2014 19:58:18 UTC +00:00]]
|
74067
|
+
[1m[36mSQL (14.2ms)[0m [1mINSERT INTO "polyblock_blocks" ("contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?)[0m [["contentable_id", 2], ["contentable_type", "Event"], ["created_at", Sun, 27 Jul 2014 19:58:18 UTC +00:00], ["name", :description], ["updated_at", Sun, 27 Jul 2014 19:58:18 UTC +00:00]]
|
74068
|
+
[1m[35m (1.7ms)[0m commit transaction
|
74069
|
+
[1m[36mEvent Load (0.3ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1[0m
|
74070
|
+
[1m[35mPolyblock::Block Load (58.8ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 2], ["contentable_type", "Event"]]
|
74071
|
+
[1m[36mEvent Load (0.3ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1[0m
|
74072
|
+
[1m[35mPolyblock::Block Load (0.3ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 2], ["contentable_type", "Event"]]
|
74073
|
+
[1m[36mEvent Load (0.2ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1[0m
|
74074
|
+
[1m[35mPolyblock::Block Load (0.2ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 2], ["contentable_type", "Event"]]
|
74075
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
74076
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
74077
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
74078
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
74079
|
+
[1m[36mEvent Load (18.7ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1[0m
|
74080
|
+
[1m[35mPolyblock::Block Load (14.9ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 1], ["contentable_type", "Event"]]
|
74081
|
+
[1m[36mEvent Load (0.3ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1[0m
|
74082
|
+
[1m[35mPolyblock::Block Load (0.2ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 1], ["contentable_type", "Event"]]
|
74083
|
+
[1m[36mPolyblock::Block Load (0.2ms)[0m [1mSELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' AND "polyblock_blocks"."contentable_id" = 1 GROUP BY polyblock_blocks.name[0m
|
74084
|
+
[1m[35mPolyblock::Block Load (0.3ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" ORDER BY "polyblock_blocks"."id" DESC LIMIT 1
|
74085
|
+
[1m[36mPolyblock::Block Load (35.4ms)[0m [1mSELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' GROUP BY polyblock_blocks.name[0m
|
74086
|
+
[1m[35mEvent Load (27.9ms)[0m SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
|
74087
|
+
[1m[36mPolyblock::Block Load (0.4ms)[0m [1mSELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1[0m [["contentable_id", 1], ["contentable_type", "Event"]]
|
74088
|
+
[1m[35mPolyblock::Block Load (0.2ms)[0m SELECT polyblock_blocks.name, polyblock_blocks.content FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' AND "polyblock_blocks"."contentable_id" = 1 AND (polyblock_blocks.content IS NOT NULL AND polyblock_blocks.content != '') GROUP BY polyblock_blocks.name
|
74089
|
+
[1m[36mEvent Load (0.5ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1[0m
|
74090
|
+
[1m[35mPolyblock::Block Load (37.3ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 1], ["contentable_type", "Event"]]
|
74091
|
+
[1m[36mPolyblock::Block Load (0.3ms)[0m [1mSELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' AND "polyblock_blocks"."contentable_id" = 1 GROUP BY polyblock_blocks.name[0m
|
74092
|
+
[1m[35mPolyblock::Block Load (0.3ms)[0m SELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' GROUP BY polyblock_blocks.name
|
74093
|
+
[1m[36mPolyblock::Block Load (0.3ms)[0m [1mSELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' GROUP BY polyblock_blocks.name[0m
|
74094
|
+
[1m[35mPolyblock::Block Load (0.2ms)[0m SELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' GROUP BY polyblock_blocks.name
|
74095
|
+
[1m[36mPolyblock::Block Load (36.0ms)[0m [1mSELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' GROUP BY polyblock_blocks.name[0m
|
74096
|
+
[1m[35m (0.2ms)[0m begin transaction
|
74097
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
74098
|
+
[1m[35m (0.1ms)[0m begin transaction
|
74099
|
+
[1m[36mSQL (125.0ms)[0m [1mINSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Sun, 27 Jul 2014 20:27:13 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:27:13 UTC +00:00]]
|
74100
|
+
[1m[35m (22.3ms)[0m rollback transaction
|
74101
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
74102
|
+
[1m[35mSQL (17.5ms)[0m INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 27 Jul 2014 20:27:36 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:27:36 UTC +00:00]]
|
74103
|
+
[1m[36mSQL (0.7ms)[0m [1mINSERT INTO "polyblock_blocks" ("content", "contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["content", "Test test"], ["contentable_id", 3], ["contentable_type", "Event"], ["created_at", Sun, 27 Jul 2014 20:27:36 UTC +00:00], ["name", "description"], ["updated_at", Sun, 27 Jul 2014 20:27:36 UTC +00:00]]
|
74104
|
+
[1m[35m (25.7ms)[0m commit transaction
|
74105
|
+
[1m[36mEvent Load (0.3ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1[0m
|
74106
|
+
[1m[35mPolyblock::Block Load (21.9ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 3], ["contentable_type", "Event"]]
|
74107
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
74108
|
+
[1m[35mSQL (0.7ms)[0m INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 27 Jul 2014 20:28:10 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:28:10 UTC +00:00]]
|
74109
|
+
[1m[36mSQL (11.3ms)[0m [1mINSERT INTO "polyblock_blocks" ("content", "contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["content", "<p>Test test</p>"], ["contentable_id", 4], ["contentable_type", "Event"], ["created_at", Sun, 27 Jul 2014 20:28:10 UTC +00:00], ["name", "description"], ["updated_at", Sun, 27 Jul 2014 20:28:10 UTC +00:00]]
|
74110
|
+
[1m[35m (2.3ms)[0m commit transaction
|
74111
|
+
[1m[36mEvent Load (0.4ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1[0m
|
74112
|
+
[1m[35mPolyblock::Block Load (32.5ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 4], ["contentable_type", "Event"]]
|
74113
|
+
[1m[36mEvent Load (0.3ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1[0m
|
74114
|
+
[1m[35mPolyblock::Block Load (0.2ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 4], ["contentable_type", "Event"]]
|
74115
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
74116
|
+
[1m[35mSQL (0.7ms)[0m INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 27 Jul 2014 20:29:01 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:29:01 UTC +00:00]]
|
74117
|
+
[1m[36m (9.0ms)[0m [1mrollback transaction[0m
|
74118
|
+
[1m[35m (0.1ms)[0m begin transaction
|
74119
|
+
[1m[36mSQL (0.9ms)[0m [1mINSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Sun, 27 Jul 2014 20:30:18 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:30:18 UTC +00:00]]
|
74120
|
+
[1m[35m (0.8ms)[0m rollback transaction
|
74121
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
74122
|
+
[1m[35mSQL (0.9ms)[0m INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 27 Jul 2014 20:30:38 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:30:38 UTC +00:00]]
|
74123
|
+
[1m[36m (0.9ms)[0m [1mrollback transaction[0m
|
74124
|
+
[1m[35m (0.2ms)[0m begin transaction
|
74125
|
+
[1m[36mSQL (0.9ms)[0m [1mINSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Sun, 27 Jul 2014 20:31:17 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:31:17 UTC +00:00]]
|
74126
|
+
[1m[35m (84.1ms)[0m rollback transaction
|
74127
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
74128
|
+
[1m[35mSQL (1.2ms)[0m INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 27 Jul 2014 20:31:32 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:31:32 UTC +00:00]]
|
74129
|
+
[1m[36m (10.9ms)[0m [1mrollback transaction[0m
|
74130
|
+
[1m[35m (0.2ms)[0m begin transaction
|
74131
|
+
[1m[36mSQL (57.6ms)[0m [1mINSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Sun, 27 Jul 2014 20:32:08 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:32:08 UTC +00:00]]
|
74132
|
+
[1m[35m (14.7ms)[0m rollback transaction
|
74133
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
74134
|
+
[1m[35mSQL (0.8ms)[0m INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 27 Jul 2014 20:32:12 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:32:12 UTC +00:00]]
|
74135
|
+
[1m[36m (0.6ms)[0m [1mrollback transaction[0m
|
74136
|
+
[1m[35m (0.3ms)[0m begin transaction
|
74137
|
+
[1m[36mSQL (1.3ms)[0m [1mINSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Sun, 27 Jul 2014 20:32:35 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:32:35 UTC +00:00]]
|
74138
|
+
[1m[35m (0.9ms)[0m rollback transaction
|
74139
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
74140
|
+
[1m[35mSQL (7.1ms)[0m INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 27 Jul 2014 20:32:38 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:32:38 UTC +00:00]]
|
74141
|
+
[1m[36m (1.5ms)[0m [1mrollback transaction[0m
|
74142
|
+
[1m[35m (0.1ms)[0m begin transaction
|
74143
|
+
[1m[36mSQL (0.9ms)[0m [1mINSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Sun, 27 Jul 2014 20:32:44 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:32:44 UTC +00:00]]
|
74144
|
+
[1m[35m (8.9ms)[0m rollback transaction
|
74145
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
74146
|
+
[1m[35mSQL (0.8ms)[0m INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 27 Jul 2014 20:33:56 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:33:56 UTC +00:00]]
|
74147
|
+
[1m[36mSQL (30.6ms)[0m [1mINSERT INTO "polyblock_blocks" ("content", "contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["content", "'Test test'"], ["contentable_id", 5], ["contentable_type", "Event"], ["created_at", Sun, 27 Jul 2014 20:33:56 UTC +00:00], ["name", "description"], ["updated_at", Sun, 27 Jul 2014 20:33:56 UTC +00:00]]
|
74148
|
+
[1m[35m (1.5ms)[0m commit transaction
|
74149
|
+
[1m[36mEvent Load (0.3ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1[0m
|
74150
|
+
[1m[35mPolyblock::Block Load (14.7ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 5], ["contentable_type", "Event"]]
|
74151
|
+
[1m[36mEvent Load (0.2ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1[0m
|
74152
|
+
[1m[35mPolyblock::Block Load (0.2ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 5], ["contentable_type", "Event"]]
|
74153
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
74154
|
+
[1m[35mSQL (1.1ms)[0m INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 27 Jul 2014 20:34:35 UTC +00:00], ["title", "Test"], ["updated_at", Sun, 27 Jul 2014 20:34:35 UTC +00:00]]
|
74155
|
+
[1m[36mSQL (9.2ms)[0m [1mINSERT INTO "polyblock_blocks" ("content", "contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["content", "Test test"], ["contentable_id", 6], ["contentable_type", "Event"], ["created_at", Sun, 27 Jul 2014 20:34:35 UTC +00:00], ["name", "description"], ["updated_at", Sun, 27 Jul 2014 20:34:35 UTC +00:00]]
|
74156
|
+
[1m[35m (2.2ms)[0m commit transaction
|
74157
|
+
[1m[36mEvent Load (0.3ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1[0m
|
74158
|
+
[1m[35mPolyblock::Block Load (25.9ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 6], ["contentable_type", "Event"]]
|
74159
|
+
[1m[36mEvent Load (0.2ms)[0m [1mSELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1[0m
|
74160
|
+
[1m[35mPolyblock::Block Load (25.4ms)[0m SELECT "polyblock_blocks".* FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_id" = ? AND "polyblock_blocks"."contentable_type" = ? AND "polyblock_blocks"."name" = 'description' LIMIT 1 [["contentable_id", 6], ["contentable_type", "Event"]]
|
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.
|
4
|
+
version: 0.8.0
|
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-07-
|
11
|
+
date: 2014-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -202,8 +202,11 @@ files:
|
|
202
202
|
- lib/generators/polyblock/install/templates/polyblock_migration.rb
|
203
203
|
- lib/polyblock.rb
|
204
204
|
- lib/polyblock/engine.rb
|
205
|
+
- lib/polyblock/glue.rb
|
205
206
|
- lib/polyblock/has_polyblock.rb
|
206
207
|
- lib/polyblock/railtie.rb
|
208
|
+
- lib/polyblock/validators.rb
|
209
|
+
- lib/polyblock/validators/polyblock_presence_validator.rb
|
207
210
|
- lib/polyblock/version.rb
|
208
211
|
- lib/polyblock/view_helpers.rb
|
209
212
|
- lib/tasks/ckeditor.rake
|