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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3595480994acbccbad005507cca34f5b9468bab7
4
- data.tar.gz: 9232b95f5436613838dac04976cb900323da67c8
3
+ metadata.gz: f0fb6298e64061cd2c8bbebc406534db1ec825f2
4
+ data.tar.gz: f0732510ca23e09e814814d91f8afa9059bb864c
5
5
  SHA512:
6
- metadata.gz: a59b76d4d347504718d1d61052b90bb7afc47d9c45c757d05935192a2f2220f1fe8dda1ef81b73dcca8d59a510eea511aae91b82f333474653f1e981ae72543d
7
- data.tar.gz: 8fb19556b5e38d33381d44b83cc533eaddfd2e346e9c305d7ac42eb9f4ccbd92ed4038d50e5f651dcd9e614571e9f26fb18fc2d39cedb8d6d156c078f04d7181
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('&nbsp;', ' ')
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
@@ -38,6 +38,7 @@ module Polyblock
38
38
  "//= require polyblock/init\n"
39
39
  end
40
40
  end
41
+
41
42
  end
42
43
  end
43
44
  end
@@ -0,0 +1,9 @@
1
+ require 'polyblock/validators'
2
+
3
+ module Polyblock
4
+ module Glue
5
+ def self.included(base)
6
+ base.send :include, Validators
7
+ end
8
+ end
9
+ end
@@ -7,17 +7,42 @@ module Polyblock
7
7
 
8
8
  module ClassMethods
9
9
  def has_polyblock(name, options={})
10
- defaults = {:class_name => "Polyblock::Block", :as => :contentable, :dependent => :destroy}
11
- has_one name, -> { where(:name => name) }, defaults.merge(options)
12
- accepts_nested_attributes_for name
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Polyblock
2
- VERSION = "0.7.2"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -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 : "[Editable content space for Polyblock <code>#{name}</code>]"
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
- content = CGI.unescapeHTML(content.gsub('<br><br>', '<br>').gsub('&nbsp;', ' '))
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
@@ -1,5 +1,6 @@
1
1
  class Event < ActiveRecord::Base
2
2
 
3
- has_polyblock :description
3
+ has_polyblock :description, :html => false
4
+ validates_polyblock_presence :description
4
5
 
5
6
  end
@@ -1,7 +1,7 @@
1
1
  Rails.application.routes.draw do
2
2
  resources :events
3
+ root :to => "home#index"
3
4
 
4
5
  mount Ckeditor::Engine => '/ckeditor'
5
- root :to => "home#index"
6
6
  mount Polyblock::Engine => "/polyblock"
7
7
  end
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
+ Polyblock::Block Load (24.6ms) SELECT "polyblock_blocks".* FROM "polyblock_blocks" ORDER BY "polyblock_blocks"."id" DESC LIMIT 1
74041
+ Polyblock::Block Load (0.2ms) SELECT "polyblock_blocks".* FROM "polyblock_blocks" ORDER BY "polyblock_blocks"."id" DESC LIMIT 1
74042
+ Event Load (0.4ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74043
+  (0.1ms) begin transaction
74044
+ SQL (60.1ms) INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["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
+ SQL (14.4ms) 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
+  (2.1ms) commit transaction
74047
+ Event Load (0.4ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74048
+ Polyblock::Block Load (39.9ms) 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"]]
74049
+ Event Load (17.7ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74050
+ Polyblock::Block Load (48.0ms) 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
+ Event Load (17.9ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74052
+ Polyblock::Block Load (14.9ms) 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
+ Event Load (0.5ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74054
+ Polyblock::Block Load (82.2ms) 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
+ Event Load (18.4ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74056
+ Polyblock::Block Load (36.6ms) 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
+ Event Load (0.2ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74058
+ Polyblock::Block Load (0.2ms) 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
+ Event Load (0.2ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74060
+ Polyblock::Block Load (0.2ms) 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
+  (0.1ms) begin transaction
74062
+  (0.1ms) rollback transaction
74063
+  (0.2ms) begin transaction
74064
+  (0.2ms) rollback transaction
74065
+  (0.1ms) begin transaction
74066
+ SQL (85.2ms) 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
+ SQL (14.2ms) INSERT INTO "polyblock_blocks" ("contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?) [["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
+  (1.7ms) commit transaction
74069
+ Event Load (0.3ms) SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
74070
+ Polyblock::Block Load (58.8ms) 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
+ Event Load (0.3ms) SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
74072
+ Polyblock::Block Load (0.3ms) 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
+ Event Load (0.2ms) SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
74074
+ Polyblock::Block Load (0.2ms) 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
+  (0.2ms) begin transaction
74076
+  (0.1ms) rollback transaction
74077
+  (0.1ms) begin transaction
74078
+  (0.1ms) rollback transaction
74079
+ Event Load (18.7ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74080
+ Polyblock::Block Load (14.9ms) 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
+ Event Load (0.3ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74082
+ Polyblock::Block Load (0.2ms) 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
+ Polyblock::Block Load (0.2ms) SELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' AND "polyblock_blocks"."contentable_id" = 1 GROUP BY polyblock_blocks.name
74084
+ Polyblock::Block Load (0.3ms) SELECT "polyblock_blocks".* FROM "polyblock_blocks" ORDER BY "polyblock_blocks"."id" DESC LIMIT 1
74085
+ Polyblock::Block Load (35.4ms) SELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' GROUP BY polyblock_blocks.name
74086
+ Event Load (27.9ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74087
+ Polyblock::Block Load (0.4ms) 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"]]
74088
+ Polyblock::Block Load (0.2ms) 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
+ Event Load (0.5ms) SELECT "events".* FROM "events" ORDER BY "events"."id" ASC LIMIT 1
74090
+ Polyblock::Block Load (37.3ms) 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
+ Polyblock::Block Load (0.3ms) SELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' AND "polyblock_blocks"."contentable_id" = 1 GROUP BY polyblock_blocks.name
74092
+ Polyblock::Block Load (0.3ms) SELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' GROUP BY polyblock_blocks.name
74093
+ Polyblock::Block Load (0.3ms) SELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' GROUP BY polyblock_blocks.name
74094
+ Polyblock::Block Load (0.2ms) SELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' GROUP BY polyblock_blocks.name
74095
+ Polyblock::Block Load (36.0ms) SELECT polyblock_blocks.name FROM "polyblock_blocks" WHERE "polyblock_blocks"."contentable_type" = 'Event' GROUP BY polyblock_blocks.name
74096
+  (0.2ms) begin transaction
74097
+  (0.1ms) rollback transaction
74098
+  (0.1ms) begin transaction
74099
+ SQL (125.0ms) INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["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
+  (22.3ms) rollback transaction
74101
+  (0.1ms) begin transaction
74102
+ SQL (17.5ms) 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
+ SQL (0.7ms) INSERT INTO "polyblock_blocks" ("content", "contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["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
+  (25.7ms) commit transaction
74105
+ Event Load (0.3ms) SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
74106
+ Polyblock::Block Load (21.9ms) 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
+  (0.1ms) begin transaction
74108
+ SQL (0.7ms) 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
+ SQL (11.3ms) INSERT INTO "polyblock_blocks" ("content", "contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["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
+  (2.3ms) commit transaction
74111
+ Event Load (0.4ms) SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
74112
+ Polyblock::Block Load (32.5ms) 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
+ Event Load (0.3ms) SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
74114
+ Polyblock::Block Load (0.2ms) 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
+  (0.1ms) begin transaction
74116
+ SQL (0.7ms) 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
+  (9.0ms) rollback transaction
74118
+  (0.1ms) begin transaction
74119
+ SQL (0.9ms) INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["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
+  (0.8ms) rollback transaction
74121
+  (0.1ms) begin transaction
74122
+ SQL (0.9ms) 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
+  (0.9ms) rollback transaction
74124
+  (0.2ms) begin transaction
74125
+ SQL (0.9ms) INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["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
+  (84.1ms) rollback transaction
74127
+  (0.3ms) begin transaction
74128
+ SQL (1.2ms) 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
+  (10.9ms) rollback transaction
74130
+  (0.2ms) begin transaction
74131
+ SQL (57.6ms) INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["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
+  (14.7ms) rollback transaction
74133
+  (0.1ms) begin transaction
74134
+ SQL (0.8ms) 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
+  (0.6ms) rollback transaction
74136
+  (0.3ms) begin transaction
74137
+ SQL (1.3ms) INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["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
+  (0.9ms) rollback transaction
74139
+  (0.2ms) begin transaction
74140
+ SQL (7.1ms) 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
+  (1.5ms) rollback transaction
74142
+  (0.1ms) begin transaction
74143
+ SQL (0.9ms) INSERT INTO "events" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["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
+  (8.9ms) rollback transaction
74145
+  (0.1ms) begin transaction
74146
+ SQL (0.8ms) 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
+ SQL (30.6ms) INSERT INTO "polyblock_blocks" ("content", "contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["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
+  (1.5ms) commit transaction
74149
+ Event Load (0.3ms) SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
74150
+ Polyblock::Block Load (14.7ms) 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
+ Event Load (0.2ms) SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
74152
+ Polyblock::Block Load (0.2ms) 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
+  (0.2ms) begin transaction
74154
+ SQL (1.1ms) 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
+ SQL (9.2ms) INSERT INTO "polyblock_blocks" ("content", "contentable_id", "contentable_type", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["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
+  (2.2ms) commit transaction
74157
+ Event Load (0.3ms) SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
74158
+ Polyblock::Block Load (25.9ms) 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
+ Event Load (0.2ms) SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
74160
+ Polyblock::Block Load (25.4ms) 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.7.2
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-26 00:00:00.000000000 Z
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