page_parts 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 967503cfb44967b8cc7c9548cf0d87cf48588590
4
+ data.tar.gz: ccaa61711a8a49dc8744c12d624c61c120e7411f
5
+ SHA512:
6
+ metadata.gz: e233c671da198cb80414d5633dcb20dc63e8ea5397a7a126481dbfe3b3c54b15c8603d4f3ce2ab405bd2c9b8e43a1b97c5d3ffb2801d0605a8a59cbd38b03084
7
+ data.tar.gz: b527c541a052513c7b97cdee4c8ac138d01ff67ca0ce7eb8ec82d40b882887cab2aec5de3ea0acc1701fcb34d0bff53d1026e23691d3c90e0c1c901839999dfd
@@ -1,4 +1,4 @@
1
- Copyright 2011 AIMBULANCE
1
+ Copyright 2012 FODOJO LLC
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -0,0 +1,49 @@
1
+ # PageParts
2
+
3
+ [![Build Status](https://semaphoreci.com/api/v1/igor-galeta/page_parts/branches/master/shields_badge.svg)](https://semaphoreci.com/igor-galeta/page_parts)
4
+
5
+ Enable dynamic string attributes in your model
6
+
7
+ ## Install
8
+
9
+ gem 'page_parts'
10
+
11
+ ActiveRecord:
12
+
13
+ require 'page_parts/orm/active_record'
14
+ rake page_parts_engine:install:migrations
15
+
16
+ Mongoid:
17
+
18
+ require 'page_parts/orm/mongoid'
19
+
20
+ ## Usage
21
+
22
+ Setup fields at your model:
23
+
24
+ class Category < ActiveRecord::Base
25
+ include PageParts::Extension
26
+
27
+ page_parts :content, :sidebar
28
+ end
29
+
30
+ Use fields as normal attributes:
31
+
32
+ @category = Category.new
33
+ @category.content = "Some text"
34
+ @category.sidebar = "Sidebar text"
35
+ @category.save
36
+
37
+ Setup fields with suffixes:
38
+
39
+ page_parts :sidebar, suffix: [:en, :uk]
40
+
41
+ page_parts :content, suffix: I18n.available_locales
42
+
43
+ It generates attributes: sidebar_en, sidebar_uk
44
+
45
+ ## Tests
46
+
47
+ rake test
48
+
49
+ Copyright (c) 2012 Fodojo, released under the MIT license
data/Rakefile CHANGED
@@ -31,4 +31,4 @@ Rake::TestTask.new(:test) do |t|
31
31
  t.verbose = false
32
32
  end
33
33
 
34
- task :default => :test
34
+ task default: :test
@@ -1,15 +1,15 @@
1
1
  class CreatePageParts < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :page_parts do |t|
4
- t.string :key, :limit => 10, :null => false
4
+ t.string :key, limit: 20, null: false
5
5
  t.text :content
6
-
7
- t.integer :partable_id, :null => false
8
- t.string :partable_type, :limit => 50, :null => false
9
-
6
+
7
+ t.integer :partable_id, null: false
8
+ t.string :partable_type, limit: 80, null: false
9
+
10
10
  t.timestamps
11
11
  end
12
-
12
+
13
13
  add_index :page_parts, :key
14
14
  add_index :page_parts, [:partable_type, :partable_id]
15
15
  end
@@ -1,7 +1,6 @@
1
- require 'orm_adapter'
2
-
3
1
  module PageParts
4
- autoload :Extension, "page_parts/extension"
2
+ autoload :Extension, 'page_parts/extension'
5
3
  end
6
4
 
7
- require 'page_parts/engine'
5
+ require 'page_parts/rails'
6
+ require 'page_parts/version'
@@ -3,34 +3,34 @@ require 'active_support/concern'
3
3
  module PageParts
4
4
  module Extension
5
5
  extend ActiveSupport::Concern
6
-
6
+
7
7
  included do
8
- class_attribute :page_parts_definitions, :instance_writer => false
9
- self.page_parts_definitions = { :keys => [] }
10
-
11
- has_many :page_parts, :as => :partable, :dependent => :destroy, :autosave => true
12
-
13
- accepts_nested_attributes_for :page_parts, :reject_if => :all_blank, :allow_destroy => true
8
+ class_attribute :page_parts_definitions, instance_writer: false
9
+ self.page_parts_definitions = { keys: [] }
10
+
11
+ has_many :page_parts, as: :partable, dependent: :destroy, autosave: true
12
+
13
+ accepts_nested_attributes_for :page_parts, reject_if: :all_blank, allow_destroy: true
14
14
  end
15
-
15
+
16
16
  module ClassMethods
17
17
  ## PageParts
18
18
  # Enable page parts in your model:
19
19
  #
20
- # page_parts :main, :left, :sidebar, :suffix => [:ru, :en, :uk]
20
+ # page_parts :main, :left, :sidebar, suffix: [:en, :uk]
21
21
  #
22
22
  def page_parts(*args)
23
- options = { :suffix => [nil] }.merge(args.extract_options!)
24
-
23
+ options = { suffix: [nil] }.merge(args.extract_options!)
24
+
25
25
  args.each do |attr_name|
26
- Array.wrap(options[:suffix]).each do |suffix|
26
+ Array(options[:suffix]).each do |suffix|
27
27
  method_name = [attr_name, suffix].compact.map(&:to_s).join('_')
28
- self.page_parts_definitions[:keys] << method_name
29
-
28
+ page_parts_definitions[:keys] << method_name
29
+
30
30
  define_method(method_name) do
31
31
  _page_part(method_name).try(:content)
32
32
  end
33
-
33
+
34
34
  define_method("#{method_name}=") do |value|
35
35
  record = _page_part(method_name)
36
36
  record.content = value
@@ -39,36 +39,35 @@ module PageParts
39
39
  end
40
40
  end
41
41
  end
42
-
42
+
43
43
  # Find page part by key or build new record
44
44
  def find_or_build_page_part(attr_name)
45
45
  key = normalize_page_part_key(attr_name)
46
- self.page_parts.detect { |record| record.key.to_s == key } || self.page_parts.build(:key => key)
46
+ page_parts.detect { |record| record.key.to_s == key } || page_parts.build(key: key)
47
47
  end
48
48
 
49
49
  def reload(*args)
50
50
  @cached_page_parts = nil
51
51
  super(*args)
52
52
  end
53
-
53
+
54
54
  protected
55
-
56
- # Save page parts records into one hash
57
- def _page_part(attr_name)
58
- key = normalize_page_part_key(attr_name)
59
- @cached_page_parts ||= {}
60
- @cached_page_parts[key] ||= find_or_build_page_part(key)
61
- end
62
-
63
- def normalize_page_part_key(value)
64
- key = value.to_s.downcase.strip
65
-
66
- unless self.page_parts_definitions[:keys].include?(key)
67
- raise NoMethodError, "Page part #{key} not registered"
68
- end
69
-
70
- key
55
+
56
+ # Save page parts records into one hash
57
+ def _page_part(attr_name)
58
+ key = normalize_page_part_key(attr_name)
59
+ @cached_page_parts ||= {}
60
+ @cached_page_parts[key] ||= find_or_build_page_part(key)
61
+ end
62
+
63
+ def normalize_page_part_key(value)
64
+ key = value.to_s.downcase.strip
65
+
66
+ unless page_parts_definitions[:keys].include?(key)
67
+ raise NoMethodError, "Page part #{key} not registered"
71
68
  end
72
-
69
+
70
+ key
71
+ end
73
72
  end
74
73
  end
@@ -1,6 +1,5 @@
1
1
  class PagePart < ::ActiveRecord::Base
2
- belongs_to :partable, :polymorphic => true
3
-
4
- validates_presence_of :key, :partable_type
5
- validates_uniqueness_of :key, :scope => [:partable_type, :partable_id]
6
- end
2
+ belongs_to :partable, polymorphic: true
3
+
4
+ validates :key, presence: true
5
+ end
@@ -5,14 +5,13 @@ class PagePart
5
5
  include Mongoid::Timestamps
6
6
 
7
7
  # Columns
8
- field :key, :type => String
9
- field :content, :type => String
8
+ field :key, type: String
9
+ field :content, type: String
10
10
 
11
- index({:key => 1})
11
+ index(key: 1)
12
12
 
13
13
  # Relations
14
- belongs_to :partable, :polymorphic => true, :index => true
15
-
16
- validates_presence_of :key, :partable_type
17
- validates_uniqueness_of :key, :scope => [:partable_type, :partable_id]
14
+ belongs_to :partable, polymorphic: true, index: true
15
+
16
+ validates_presence_of :key
18
17
  end
@@ -1,2 +1 @@
1
- require 'orm_adapter/adapters/active_record'
2
1
  require 'page_parts/models/active_record/page_part'
@@ -1,2 +1 @@
1
- require 'orm_adapter/adapters/mongoid'
2
1
  require 'page_parts/models/mongoid/page_part'
@@ -1,7 +1,7 @@
1
1
  require 'rails'
2
- require 'page_parts'
3
2
 
4
3
  module PageParts #:nodoc:
5
4
  class Engine < ::Rails::Engine #:nodoc:
6
5
  end
7
6
  end
7
+
@@ -1,3 +1,3 @@
1
1
  module PageParts
2
- VERSION = "0.1.3"
2
+ VERSION = '0.1.4'.freeze
3
3
  end
@@ -3,13 +3,14 @@ Dummy::Application.configure do
3
3
 
4
4
  # Code is not reloaded between requests
5
5
  config.cache_classes = true
6
+ config.eager_load = true
6
7
 
7
8
  # Full error reports are disabled and caching is turned on
8
9
  config.consider_all_requests_local = false
9
10
  config.action_controller.perform_caching = true
10
11
 
11
12
  # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
13
+ config.serve_static_files = false
13
14
 
14
15
  # Compress JavaScripts and CSS
15
16
  config.assets.compress = true
@@ -6,9 +6,10 @@ Dummy::Application.configure do
6
6
  # your test database is "scratch space" for the test suite and is wiped
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
+ config.eager_load = false
9
10
 
10
11
  # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
+ config.serve_static_files = true
12
13
  config.static_cache_control = "public, max-age=3600"
13
14
 
14
15
  # Log error messages when you accidentally call methods on nil
@@ -36,4 +37,6 @@ Dummy::Application.configure do
36
37
 
37
38
  # Print deprecation notices to the stderr
38
39
  config.active_support.deprecation = :stderr
40
+
41
+ config.active_support.test_order = :sorted
39
42
  end
@@ -1,84 +1,1039 @@
1
-  (0.1ms) select sqlite_version(*)
2
-  (155.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
3
-  (0.1ms) PRAGMA index_list("schema_migrations")
4
-  (79.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
6
- Migrating to CreatePageParts (20111226144515)
7
-  (1.0ms) CREATE TABLE "page_parts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(10) NOT NULL, "content" text, "partable_id" integer NOT NULL, "partable_type" varchar(50) NOT NULL, "created_at" datetime, "updated_at" datetime)
8
-  (0.1ms) PRAGMA index_list("page_parts")
9
-  (0.4ms) CREATE INDEX "index_page_parts_on_key" ON "page_parts" ("key")
10
-  (0.1ms) PRAGMA index_list("page_parts")
11
-  (0.1ms) PRAGMA index_info('index_page_parts_on_key')
12
-  (0.4ms) CREATE INDEX "index_page_parts_on_partable_type_and_partable_id" ON "page_parts" ("partable_type", "partable_id")
13
-  (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20111226144515')
14
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
15
- Migrating to CreateCategories (20111226131910)
16
-  (0.8ms) CREATE TABLE "categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime)
17
-  (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20111226131910')
18
- Migrating to CreatePosts (20120124093705)
19
-  (0.8ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "is_visible" boolean, "created_at" datetime, "updated_at" datetime)
20
-  (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20120124093705')
1
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
3
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+  (0.1ms) begin transaction
5
+ ------------------------------------------------
6
+ PostTest: test_should_has_page_parts_definitions
7
+ ------------------------------------------------
8
+  (0.1ms) rollback transaction
9
+  (0.1ms) begin transaction
10
+ -------------------------------------------------
11
+ PostTest: test_should_load_page_parts_into_record
12
+ -------------------------------------------------
13
+  (0.1ms) SAVEPOINT active_record_1
14
+ SQL (0.9ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:07:06.491482"], ["updated_at", "2016-10-07 11:07:06.491482"]]
15
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.496265"], ["updated_at", "2016-10-07 11:07:06.496265"]]
16
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content_uk"], ["partable_type", "Post"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.497689"], ["updated_at", "2016-10-07 11:07:06.497689"]]
17
+  (0.1ms) RELEASE SAVEPOINT active_record_1
18
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", 1]]
19
+ PagePart Load (0.2ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Post"]]
20
+  (1.3ms) rollback transaction
21
+  (0.1ms) begin transaction
22
+ -------------------------------------------------------------
23
+ PostTest: test_should_raise_error_on_not_registered_page_part
24
+ -------------------------------------------------------------
25
+  (0.1ms) rollback transaction
26
+  (0.1ms) begin transaction
27
+ -----------------------------------------------------
28
+ PostTest: test_should_save_page_parts_with_new_record
29
+ -----------------------------------------------------
30
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
31
+  (0.1ms) SAVEPOINT active_record_1
32
+ SQL (0.2ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:07:06.510799"], ["updated_at", "2016-10-07 11:07:06.510799"]]
33
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Title ru"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.511929"], ["updated_at", "2016-10-07 11:07:06.511929"]]
34
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_en"], ["partable_type", "Post"], ["content", "Title en"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.512958"], ["updated_at", "2016-10-07 11:07:06.512958"]]
35
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content_ru"], ["partable_type", "Post"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.513850"], ["updated_at", "2016-10-07 11:07:06.513850"]]
36
+  (0.1ms) RELEASE SAVEPOINT active_record_1
37
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
38
+  (0.4ms) rollback transaction
39
+  (0.1ms) begin transaction
40
+ -----------------------------------------------------------------
41
+ PagePartTest: test_should_create_new_record_with_valid_attributes
42
+ -----------------------------------------------------------------
21
43
   (0.1ms) SAVEPOINT active_record_1
22
-  (0.3ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'sidebar' AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" IS NULL) LIMIT 1
23
-  (0.2ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'content' AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" IS NULL) LIMIT 1
24
- SQL (2.8ms) INSERT INTO "categories" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["title", "Test category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
25
- SQL (0.8ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", "Sidebar"], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "sidebar"], ["partable_id", 1], ["partable_type", "Category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
26
- SQL (0.4ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", "Main"], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "content"], ["partable_id", 1], ["partable_type", "Category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
27
-  (0.1ms) RELEASE SAVEPOINT active_record_1
28
- Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
29
- PagePart Load (0.4ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = 1 AND "page_parts"."partable_type" = 'Category'
30
-  (0.3ms) SELECT COUNT(*) FROM "page_parts" 
44
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "somekey"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.518333"], ["updated_at", "2016-10-07 11:07:06.518333"]]
45
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46
+  (0.3ms) rollback transaction
47
+  (0.1ms) begin transaction
48
+ -----------------------------------------------------
49
+ PagePartTest: test_should_not_be_valid_with_empty_key
50
+ -----------------------------------------------------
51
+  (0.1ms) rollback transaction
52
+  (0.1ms) begin transaction
53
+ --------------------------------------------------------
54
+ PagePartTest: test_should_not_be_valid_with_not_uniq_key
55
+ --------------------------------------------------------
56
+  (0.0ms) SAVEPOINT active_record_1
57
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "test"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.531056"], ["updated_at", "2016-10-07 11:07:06.531056"]]
58
+  (0.0ms) RELEASE SAVEPOINT active_record_1
59
+  (0.4ms) rollback transaction
60
+  (0.1ms) begin transaction
61
+ ------------------------
62
+ PagePartTest: test_truth
63
+ ------------------------
64
+  (0.0ms) rollback transaction
65
+  (0.0ms) begin transaction
66
+ ----------------------------------------------------
67
+ CategoryTest: test_should_has_page_parts_definitions
68
+ ----------------------------------------------------
69
+  (0.1ms) rollback transaction
70
+  (0.1ms) begin transaction
71
+ -----------------------------------------------------
72
+ CategoryTest: test_should_load_page_parts_into_record
73
+ -----------------------------------------------------
31
74
   (0.1ms) SAVEPOINT active_record_1
32
-  (0.3ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'sidebar' AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" IS NULL) LIMIT 1
33
-  (0.2ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'content' AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" IS NULL) LIMIT 1
34
- SQL (0.6ms) INSERT INTO "categories" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["title", "Test category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
35
- SQL (0.5ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", "Sidebar content"], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "sidebar"], ["partable_id", 1], ["partable_type", "Category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
36
- SQL (0.8ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", nil], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "content"], ["partable_id", 1], ["partable_type", "Category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
75
+ SQL (0.7ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:07:06.542155"], ["updated_at", "2016-10-07 11:07:06.542155"]]
76
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.545387"], ["updated_at", "2016-10-07 11:07:06.545387"]]
77
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.547945"], ["updated_at", "2016-10-07 11:07:06.547945"]]
78
+  (0.1ms) RELEASE SAVEPOINT active_record_1
79
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
80
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
81
+  (0.3ms) rollback transaction
82
+  (0.1ms) begin transaction
83
+ -----------------------------------------------------------------
84
+ CategoryTest: test_should_raise_error_on_not_registered_page_part
85
+ -----------------------------------------------------------------
86
+  (0.0ms) rollback transaction
87
+  (0.1ms) begin transaction
88
+ ---------------------------------------------------------
89
+ CategoryTest: test_should_save_page_parts_with_new_record
90
+ ---------------------------------------------------------
91
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
92
+  (0.0ms) SAVEPOINT active_record_1
93
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:07:06.556770"], ["updated_at", "2016-10-07 11:07:06.556770"]]
94
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar content"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.557919"], ["updated_at", "2016-10-07 11:07:06.557919"]]
95
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.558939"], ["updated_at", "2016-10-07 11:07:06.558939"]]
96
+  (0.0ms) RELEASE SAVEPOINT active_record_1
97
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
98
+  (0.3ms) rollback transaction
99
+  (0.1ms) begin transaction
100
+ -------------------------------------------
101
+ CategoryTest: test_should_update_page_parts
102
+ -------------------------------------------
103
+  (0.0ms) SAVEPOINT active_record_1
104
+ SQL (0.4ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:07:06.563181"], ["updated_at", "2016-10-07 11:07:06.563181"]]
105
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.564535"], ["updated_at", "2016-10-07 11:07:06.564535"]]
106
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:07:06.566034"], ["updated_at", "2016-10-07 11:07:06.566034"]]
107
+  (0.1ms) RELEASE SAVEPOINT active_record_1
108
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
109
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
110
+  (0.1ms) SAVEPOINT active_record_1
111
+ SQL (0.5ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Sidebar 2"], ["updated_at", "2016-10-07 11:07:06.570372"], ["id", 1]]
112
+ SQL (0.3ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Main 2"], ["updated_at", "2016-10-07 11:07:06.573353"], ["id", 2]]
37
113
   (0.1ms) RELEASE SAVEPOINT active_record_1
38
-  (0.2ms) SELECT COUNT(*) FROM "page_parts" 
114
+ Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
115
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
116
+  (0.7ms) rollback transaction
117
+  (0.1ms) begin transaction
118
+ ------------------------
119
+ CategoryTest: test_truth
120
+ ------------------------
121
+  (0.1ms) rollback transaction
122
+  (0.1ms) begin transaction
123
+ --------------------------------------------------
124
+ PagePartsTest: test_shound_be_included_by_Category
125
+ --------------------------------------------------
126
+  (0.0ms) rollback transaction
127
+  (0.1ms) begin transaction
128
+ -------------------------
129
+ PagePartsTest: test_truth
130
+ -------------------------
131
+  (0.0ms) rollback transaction
132
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
133
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
134
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
135
+  (0.1ms) begin transaction
136
+ ------------------------------------------------
137
+ PostTest: test_should_has_page_parts_definitions
138
+ ------------------------------------------------
139
+  (0.1ms) rollback transaction
140
+  (0.1ms) begin transaction
141
+ -------------------------------------------------
142
+ PostTest: test_should_load_page_parts_into_record
143
+ -------------------------------------------------
144
+  (0.1ms) SAVEPOINT active_record_1
145
+ SQL (0.8ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:08:13.323600"], ["updated_at", "2016-10-07 11:08:13.323600"]]
146
+ SQL (0.4ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.328401"], ["updated_at", "2016-10-07 11:08:13.328401"]]
147
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content_uk"], ["partable_type", "Post"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.331480"], ["updated_at", "2016-10-07 11:08:13.331480"]]
148
+  (0.1ms) RELEASE SAVEPOINT active_record_1
149
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", 1]]
150
+ PagePart Load (0.2ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Post"]]
151
+  (0.3ms) rollback transaction
152
+  (0.1ms) begin transaction
153
+ -------------------------------------------------------------
154
+ PostTest: test_should_raise_error_on_not_registered_page_part
155
+ -------------------------------------------------------------
156
+  (0.0ms) rollback transaction
157
+  (0.1ms) begin transaction
158
+ -----------------------------------------------------
159
+ PostTest: test_should_save_page_parts_with_new_record
160
+ -----------------------------------------------------
161
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
162
+  (0.1ms) SAVEPOINT active_record_1
163
+ SQL (0.3ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:08:13.350221"], ["updated_at", "2016-10-07 11:08:13.350221"]]
164
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Title ru"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.351847"], ["updated_at", "2016-10-07 11:08:13.351847"]]
165
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_en"], ["partable_type", "Post"], ["content", "Title en"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.352992"], ["updated_at", "2016-10-07 11:08:13.352992"]]
166
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content_ru"], ["partable_type", "Post"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.353882"], ["updated_at", "2016-10-07 11:08:13.353882"]]
167
+  (0.0ms) RELEASE SAVEPOINT active_record_1
168
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
169
+  (0.6ms) rollback transaction
170
+  (0.1ms) begin transaction
171
+ --------------------------------------------------
172
+ PagePartsTest: test_shound_be_included_by_Category
173
+ --------------------------------------------------
174
+  (0.1ms) rollback transaction
175
+  (0.1ms) begin transaction
176
+ -------------------------
177
+ PagePartsTest: test_truth
178
+ -------------------------
179
+  (0.0ms) rollback transaction
180
+  (0.1ms) begin transaction
181
+ ----------------------------------------------------
182
+ CategoryTest: test_should_has_page_parts_definitions
183
+ ----------------------------------------------------
184
+  (0.1ms) rollback transaction
185
+  (0.1ms) begin transaction
186
+ -----------------------------------------------------
187
+ CategoryTest: test_should_load_page_parts_into_record
188
+ -----------------------------------------------------
189
+  (0.1ms) SAVEPOINT active_record_1
190
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:08:13.372268"], ["updated_at", "2016-10-07 11:08:13.372268"]]
191
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.373483"], ["updated_at", "2016-10-07 11:08:13.373483"]]
192
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.374512"], ["updated_at", "2016-10-07 11:08:13.374512"]]
193
+  (0.0ms) RELEASE SAVEPOINT active_record_1
194
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
195
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
196
+  (0.5ms) rollback transaction
197
+  (0.1ms) begin transaction
198
+ -----------------------------------------------------------------
199
+ CategoryTest: test_should_raise_error_on_not_registered_page_part
200
+ -----------------------------------------------------------------
201
+  (0.1ms) rollback transaction
202
+  (0.1ms) begin transaction
203
+ ---------------------------------------------------------
204
+ CategoryTest: test_should_save_page_parts_with_new_record
205
+ ---------------------------------------------------------
206
+  (0.2ms) SELECT COUNT(*) FROM "page_parts"
207
+  (0.0ms) SAVEPOINT active_record_1
208
+ SQL (0.2ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:08:13.383276"], ["updated_at", "2016-10-07 11:08:13.383276"]]
209
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar content"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.384616"], ["updated_at", "2016-10-07 11:08:13.384616"]]
210
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.385997"], ["updated_at", "2016-10-07 11:08:13.385997"]]
211
+  (0.1ms) RELEASE SAVEPOINT active_record_1
212
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
213
+  (0.4ms) rollback transaction
214
+  (0.1ms) begin transaction
215
+ -------------------------------------------
216
+ CategoryTest: test_should_update_page_parts
217
+ -------------------------------------------
39
218
   (0.1ms) SAVEPOINT active_record_1
40
-  (0.3ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'sidebar' AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" IS NULL) LIMIT 1
41
-  (0.2ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'content' AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" IS NULL) LIMIT 1
42
- SQL (0.6ms) INSERT INTO "categories" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["title", "Test category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
43
- SQL (0.5ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", "Sidebar"], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "sidebar"], ["partable_id", 1], ["partable_type", "Category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
44
- SQL (0.4ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", "Main"], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "content"], ["partable_id", 1], ["partable_type", "Category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
219
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:08:13.390567"], ["updated_at", "2016-10-07 11:08:13.390567"]]
220
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.391725"], ["updated_at", "2016-10-07 11:08:13.391725"]]
221
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.392728"], ["updated_at", "2016-10-07 11:08:13.392728"]]
222
+  (0.1ms) RELEASE SAVEPOINT active_record_1
223
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
224
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
225
+  (0.0ms) SAVEPOINT active_record_1
226
+ SQL (0.4ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Sidebar 2"], ["updated_at", "2016-10-07 11:08:13.396271"], ["id", 1]]
227
+ SQL (0.1ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Main 2"], ["updated_at", "2016-10-07 11:08:13.398392"], ["id", 2]]
45
228
   (0.1ms) RELEASE SAVEPOINT active_record_1
46
- Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
47
- PagePart Load (0.4ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = 1 AND "page_parts"."partable_type" = 'Category'
229
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
230
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
231
+  (0.6ms) rollback transaction
232
+  (0.1ms) begin transaction
233
+ ------------------------
234
+ CategoryTest: test_truth
235
+ ------------------------
236
+  (0.0ms) rollback transaction
237
+  (0.0ms) begin transaction
238
+ -----------------------------------------------------------------
239
+ PagePartTest: test_should_create_new_record_with_valid_attributes
240
+ -----------------------------------------------------------------
241
+  (0.0ms) SAVEPOINT active_record_1
242
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "somekey"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.404876"], ["updated_at", "2016-10-07 11:08:13.404876"]]
243
+  (0.0ms) RELEASE SAVEPOINT active_record_1
244
+  (0.3ms) rollback transaction
245
+  (0.1ms) begin transaction
246
+ -----------------------------------------------------
247
+ PagePartTest: test_should_not_be_valid_with_empty_key
248
+ -----------------------------------------------------
249
+  (0.1ms) rollback transaction
250
+  (0.1ms) begin transaction
251
+ --------------------------------------------------------
252
+ PagePartTest: test_should_not_be_valid_with_not_uniq_key
253
+ --------------------------------------------------------
254
+  (0.0ms) SAVEPOINT active_record_1
255
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "test"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:08:13.416642"], ["updated_at", "2016-10-07 11:08:13.416642"]]
256
+  (0.0ms) RELEASE SAVEPOINT active_record_1
257
+  (0.4ms) rollback transaction
258
+  (0.1ms) begin transaction
259
+ ------------------------
260
+ PagePartTest: test_truth
261
+ ------------------------
262
+  (0.0ms) rollback transaction
263
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
264
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
265
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
266
+  (0.1ms) begin transaction
267
+ --------------------------------------------------
268
+ PagePartsTest: test_shound_be_included_by_Category
269
+ --------------------------------------------------
270
+  (0.1ms) rollback transaction
271
+  (0.1ms) begin transaction
272
+ -------------------------
273
+ PagePartsTest: test_truth
274
+ -------------------------
275
+  (0.1ms) rollback transaction
276
+  (0.1ms) begin transaction
277
+ ------------------------------------------------
278
+ PostTest: test_should_has_page_parts_definitions
279
+ ------------------------------------------------
280
+  (0.1ms) rollback transaction
281
+  (0.1ms) begin transaction
282
+ -------------------------------------------------
283
+ PostTest: test_should_load_page_parts_into_record
284
+ -------------------------------------------------
48
285
   (0.1ms) SAVEPOINT active_record_1
49
-  (0.3ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'sidebar' AND "page_parts"."id" != 1 AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" = 1) LIMIT 1
50
-  (0.3ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'content' AND "page_parts"."id" != 2 AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" = 1) LIMIT 1
51
-  (15.7ms) UPDATE "page_parts" SET "content" = 'Sidebar 2', "updated_at" = '2013-01-04 16:37:46.211725' WHERE "page_parts"."id" = 1
52
-  (0.3ms) UPDATE "page_parts" SET "content" = 'Main 2', "updated_at" = '2013-01-04 16:37:46.230063' WHERE "page_parts"."id" = 2
286
+ SQL (1.1ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:13:51.863350"], ["updated_at", "2016-10-07 11:13:51.863350"]]
287
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.869787"], ["updated_at", "2016-10-07 11:13:51.869787"]]
288
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content_uk"], ["partable_type", "Post"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.872480"], ["updated_at", "2016-10-07 11:13:51.872480"]]
289
+  (0.1ms) RELEASE SAVEPOINT active_record_1
290
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", 1]]
291
+ PagePart Load (0.2ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Post"]]
292
+  (1.1ms) rollback transaction
293
+  (0.1ms) begin transaction
294
+ -------------------------------------------------------------
295
+ PostTest: test_should_raise_error_on_not_registered_page_part
296
+ -------------------------------------------------------------
297
+  (0.0ms) rollback transaction
298
+  (0.1ms) begin transaction
299
+ -----------------------------------------------------
300
+ PostTest: test_should_save_page_parts_with_new_record
301
+ -----------------------------------------------------
302
+  (0.2ms) SELECT COUNT(*) FROM "page_parts"
303
+  (0.0ms) SAVEPOINT active_record_1
304
+ SQL (0.3ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:13:51.890976"], ["updated_at", "2016-10-07 11:13:51.890976"]]
305
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Title ru"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.892126"], ["updated_at", "2016-10-07 11:13:51.892126"]]
306
+ SQL (0.0ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_en"], ["partable_type", "Post"], ["content", "Title en"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.893116"], ["updated_at", "2016-10-07 11:13:51.893116"]]
307
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content_ru"], ["partable_type", "Post"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.894001"], ["updated_at", "2016-10-07 11:13:51.894001"]]
308
+  (0.1ms) RELEASE SAVEPOINT active_record_1
309
+  (0.2ms) SELECT COUNT(*) FROM "page_parts"
310
+  (0.4ms) rollback transaction
311
+  (0.1ms) begin transaction
312
+ -----------------------------------------------------------------
313
+ PagePartTest: test_should_create_new_record_with_valid_attributes
314
+ -----------------------------------------------------------------
315
+  (0.1ms) SAVEPOINT active_record_1
316
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "somekey"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.899633"], ["updated_at", "2016-10-07 11:13:51.899633"]]
53
317
   (0.1ms) RELEASE SAVEPOINT active_record_1
54
- Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
55
- PagePart Load (0.4ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = 1 AND "page_parts"."partable_type" = 'Category'
318
+  (0.4ms) rollback transaction
319
+  (0.1ms) begin transaction
320
+ -----------------------------------------------------
321
+ PagePartTest: test_should_not_be_valid_with_empty_key
322
+ -----------------------------------------------------
323
+  (0.1ms) rollback transaction
324
+  (0.1ms) begin transaction
325
+ --------------------------------------------------------
326
+ PagePartTest: test_should_not_be_valid_with_not_uniq_key
327
+ --------------------------------------------------------
56
328
   (0.1ms) SAVEPOINT active_record_1
57
-  (0.3ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'somekey' AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" = 1) LIMIT 1
58
- SQL (0.9ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", nil], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "somekey"], ["partable_id", 1], ["partable_type", "Category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
329
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "test"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.911626"], ["updated_at", "2016-10-07 11:13:51.911626"]]
330
+  (0.1ms) RELEASE SAVEPOINT active_record_1
331
+  (0.4ms) rollback transaction
332
+  (0.1ms) begin transaction
333
+ ------------------------
334
+ PagePartTest: test_truth
335
+ ------------------------
336
+  (0.0ms) rollback transaction
337
+  (0.0ms) begin transaction
338
+ ----------------------------------------------------
339
+ CategoryTest: test_should_has_page_parts_definitions
340
+ ----------------------------------------------------
341
+  (0.1ms) rollback transaction
342
+  (0.1ms) begin transaction
343
+ -----------------------------------------------------
344
+ CategoryTest: test_should_load_page_parts_into_record
345
+ -----------------------------------------------------
346
+  (0.1ms) SAVEPOINT active_record_1
347
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:13:51.922395"], ["updated_at", "2016-10-07 11:13:51.922395"]]
348
+ SQL (0.4ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.923627"], ["updated_at", "2016-10-07 11:13:51.923627"]]
349
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.925639"], ["updated_at", "2016-10-07 11:13:51.925639"]]
59
350
   (0.1ms) RELEASE SAVEPOINT active_record_1
60
-  (0.4ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = '' AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" = 1) LIMIT 1
351
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
352
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
353
+  (0.6ms) rollback transaction
354
+  (0.1ms) begin transaction
355
+ -----------------------------------------------------------------
356
+ CategoryTest: test_should_raise_error_on_not_registered_page_part
357
+ -----------------------------------------------------------------
358
+  (0.1ms) rollback transaction
359
+  (0.1ms) begin transaction
360
+ ---------------------------------------------------------
361
+ CategoryTest: test_should_save_page_parts_with_new_record
362
+ ---------------------------------------------------------
363
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
364
+  (0.0ms) SAVEPOINT active_record_1
365
+ SQL (0.2ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:13:51.933291"], ["updated_at", "2016-10-07 11:13:51.933291"]]
366
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar content"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.934460"], ["updated_at", "2016-10-07 11:13:51.934460"]]
367
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.935466"], ["updated_at", "2016-10-07 11:13:51.935466"]]
368
+  (0.1ms) RELEASE SAVEPOINT active_record_1
369
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
370
+  (0.4ms) rollback transaction
371
+  (0.1ms) begin transaction
372
+ -------------------------------------------
373
+ CategoryTest: test_should_update_page_parts
374
+ -------------------------------------------
61
375
   (0.1ms) SAVEPOINT active_record_1
62
- SQL (1.0ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", nil], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "test"], ["partable_id", 1], ["partable_type", "Category"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
376
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:13:51.940044"], ["updated_at", "2016-10-07 11:13:51.940044"]]
377
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.941714"], ["updated_at", "2016-10-07 11:13:51.941714"]]
378
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:13:51.942776"], ["updated_at", "2016-10-07 11:13:51.942776"]]
379
+  (0.1ms) RELEASE SAVEPOINT active_record_1
380
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
381
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
382
+  (0.0ms) SAVEPOINT active_record_1
383
+ SQL (0.6ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Sidebar 2"], ["updated_at", "2016-10-07 11:13:51.946902"], ["id", 1]]
384
+ SQL (0.1ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Main 2"], ["updated_at", "2016-10-07 11:13:51.949644"], ["id", 2]]
63
385
   (0.1ms) RELEASE SAVEPOINT active_record_1
64
-  (0.3ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'test' AND "page_parts"."partable_type" = 'Category' AND "page_parts"."partable_id" = 1) LIMIT 1
386
+ Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
387
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
388
+  (0.9ms) rollback transaction
389
+  (0.1ms) begin transaction
390
+ ------------------------
391
+ CategoryTest: test_truth
392
+ ------------------------
393
+  (0.1ms) rollback transaction
394
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
395
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
396
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
397
+  (0.1ms) begin transaction
398
+ -----------------------------------------------------------------
399
+ PagePartTest: test_should_create_new_record_with_valid_attributes
400
+ -----------------------------------------------------------------
401
+  (0.1ms) SAVEPOINT active_record_1
402
+ SQL (0.7ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "somekey"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.815268"], ["updated_at", "2016-10-07 11:15:00.815268"]]
403
+  (0.1ms) RELEASE SAVEPOINT active_record_1
404
+  (0.3ms) rollback transaction
405
+  (0.1ms) begin transaction
406
+ -----------------------------------------------------
407
+ PagePartTest: test_should_not_be_valid_with_empty_key
408
+ -----------------------------------------------------
409
+  (0.1ms) rollback transaction
410
+  (0.1ms) begin transaction
411
+ --------------------------------------------------------
412
+ PagePartTest: test_should_not_be_valid_with_not_uniq_key
413
+ --------------------------------------------------------
65
414
   (0.1ms) SAVEPOINT active_record_1
66
-  (0.4ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'title_ru' AND "page_parts"."partable_type" = 'Post' AND "page_parts"."partable_id" IS NULL) LIMIT 1
67
-  (0.2ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'content_uk' AND "page_parts"."partable_type" = 'Post' AND "page_parts"."partable_id" IS NULL) LIMIT 1
68
- SQL (0.8ms) INSERT INTO "posts" ("created_at", "is_visible", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["is_visible", true], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
69
- SQL (0.5ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", "Sidebar"], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "title_ru"], ["partable_id", 1], ["partable_type", "Post"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
70
- SQL (0.4ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", "Main"], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "content_uk"], ["partable_id", 1], ["partable_type", "Post"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
71
-  (0.1ms) RELEASE SAVEPOINT active_record_1
72
- Post Load (0.3ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", 1]]
73
- PagePart Load (0.4ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = 1 AND "page_parts"."partable_type" = 'Post'
74
-  (0.3ms) SELECT COUNT(*) FROM "page_parts" 
415
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "test"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.834015"], ["updated_at", "2016-10-07 11:15:00.834015"]]
416
+  (0.1ms) RELEASE SAVEPOINT active_record_1
417
+  (0.4ms) rollback transaction
418
+  (0.1ms) begin transaction
419
+ ------------------------
420
+ PagePartTest: test_truth
421
+ ------------------------
422
+  (0.1ms) rollback transaction
423
+  (0.0ms) begin transaction
424
+ ------------------------------------------------
425
+ PostTest: test_should_has_page_parts_definitions
426
+ ------------------------------------------------
427
+  (0.1ms) rollback transaction
428
+  (0.1ms) begin transaction
429
+ -------------------------------------------------
430
+ PostTest: test_should_load_page_parts_into_record
431
+ -------------------------------------------------
432
+  (0.1ms) SAVEPOINT active_record_1
433
+ SQL (0.3ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:15:00.866830"], ["updated_at", "2016-10-07 11:15:00.866830"]]
434
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.868117"], ["updated_at", "2016-10-07 11:15:00.868117"]]
435
+ SQL (0.0ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content_uk"], ["partable_type", "Post"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.869209"], ["updated_at", "2016-10-07 11:15:00.869209"]]
436
+  (0.0ms) RELEASE SAVEPOINT active_record_1
437
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", 1]]
438
+ PagePart Load (0.2ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Post"]]
439
+  (0.4ms) rollback transaction
440
+  (0.1ms) begin transaction
441
+ -------------------------------------------------------------
442
+ PostTest: test_should_raise_error_on_not_registered_page_part
443
+ -------------------------------------------------------------
444
+  (0.0ms) rollback transaction
445
+  (0.1ms) begin transaction
446
+ -----------------------------------------------------
447
+ PostTest: test_should_save_page_parts_with_new_record
448
+ -----------------------------------------------------
449
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
450
+  (0.0ms) SAVEPOINT active_record_1
451
+ SQL (0.2ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:15:00.885900"], ["updated_at", "2016-10-07 11:15:00.885900"]]
452
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Title ru"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.886950"], ["updated_at", "2016-10-07 11:15:00.886950"]]
453
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_en"], ["partable_type", "Post"], ["content", "Title en"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.887979"], ["updated_at", "2016-10-07 11:15:00.887979"]]
454
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content_ru"], ["partable_type", "Post"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.888941"], ["updated_at", "2016-10-07 11:15:00.888941"]]
455
+  (0.1ms) RELEASE SAVEPOINT active_record_1
456
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
457
+  (0.4ms) rollback transaction
458
+  (0.0ms) begin transaction
459
+ --------------------------------------------------
460
+ PagePartsTest: test_shound_be_included_by_Category
461
+ --------------------------------------------------
462
+  (0.1ms) rollback transaction
463
+  (0.1ms) begin transaction
464
+ -------------------------
465
+ PagePartsTest: test_truth
466
+ -------------------------
467
+  (0.0ms) rollback transaction
468
+  (0.0ms) begin transaction
469
+ ----------------------------------------------------
470
+ CategoryTest: test_should_has_page_parts_definitions
471
+ ----------------------------------------------------
472
+  (0.1ms) rollback transaction
473
+  (0.1ms) begin transaction
474
+ -----------------------------------------------------
475
+ CategoryTest: test_should_load_page_parts_into_record
476
+ -----------------------------------------------------
75
477
   (0.1ms) SAVEPOINT active_record_1
76
-  (0.2ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'title_ru' AND "page_parts"."partable_type" = 'Post' AND "page_parts"."partable_id" IS NULL) LIMIT 1
77
-  (0.2ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'title_en' AND "page_parts"."partable_type" = 'Post' AND "page_parts"."partable_id" IS NULL) LIMIT 1
78
-  (0.2ms) SELECT 1 FROM "page_parts" WHERE ("page_parts"."key" = 'content_ru' AND "page_parts"."partable_type" = 'Post' AND "page_parts"."partable_id" IS NULL) LIMIT 1
79
- SQL (0.6ms) INSERT INTO "posts" ("created_at", "is_visible", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["is_visible", true], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
80
- SQL (0.6ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", "Title ru"], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "title_ru"], ["partable_id", 1], ["partable_type", "Post"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
81
- SQL (0.4ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", "Title en"], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "title_en"], ["partable_id", 1], ["partable_type", "Post"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
82
- SQL (0.7ms) INSERT INTO "page_parts" ("content", "created_at", "key", "partable_id", "partable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content", nil], ["created_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00], ["key", "content_ru"], ["partable_id", 1], ["partable_type", "Post"], ["updated_at", Fri, 04 Jan 2013 16:37:46 UTC +00:00]]
83
-  (0.1ms) RELEASE SAVEPOINT active_record_1
84
-  (0.2ms) SELECT COUNT(*) FROM "page_parts" 
478
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:15:00.902930"], ["updated_at", "2016-10-07 11:15:00.902930"]]
479
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.904142"], ["updated_at", "2016-10-07 11:15:00.904142"]]
480
+ SQL (0.0ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.905179"], ["updated_at", "2016-10-07 11:15:00.905179"]]
481
+  (0.0ms) RELEASE SAVEPOINT active_record_1
482
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
483
+ PagePart Load (0.0ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
484
+  (0.6ms) rollback transaction
485
+  (0.1ms) begin transaction
486
+ -----------------------------------------------------------------
487
+ CategoryTest: test_should_raise_error_on_not_registered_page_part
488
+ -----------------------------------------------------------------
489
+  (0.1ms) rollback transaction
490
+  (0.1ms) begin transaction
491
+ ---------------------------------------------------------
492
+ CategoryTest: test_should_save_page_parts_with_new_record
493
+ ---------------------------------------------------------
494
+  (0.2ms) SELECT COUNT(*) FROM "page_parts"
495
+  (0.0ms) SAVEPOINT active_record_1
496
+ SQL (0.2ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:15:00.913379"], ["updated_at", "2016-10-07 11:15:00.913379"]]
497
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar content"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.914458"], ["updated_at", "2016-10-07 11:15:00.914458"]]
498
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.916125"], ["updated_at", "2016-10-07 11:15:00.916125"]]
499
+  (0.1ms) RELEASE SAVEPOINT active_record_1
500
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
501
+  (0.3ms) rollback transaction
502
+  (0.1ms) begin transaction
503
+ -------------------------------------------
504
+ CategoryTest: test_should_update_page_parts
505
+ -------------------------------------------
506
+  (0.0ms) SAVEPOINT active_record_1
507
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:15:00.920419"], ["updated_at", "2016-10-07 11:15:00.920419"]]
508
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.921773"], ["updated_at", "2016-10-07 11:15:00.921773"]]
509
+ SQL (0.0ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:00.922776"], ["updated_at", "2016-10-07 11:15:00.922776"]]
510
+  (0.1ms) RELEASE SAVEPOINT active_record_1
511
+ Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
512
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
513
+  (0.1ms) SAVEPOINT active_record_1
514
+ SQL (0.4ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Sidebar 2"], ["updated_at", "2016-10-07 11:15:00.926190"], ["id", 1]]
515
+ SQL (0.1ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Main 2"], ["updated_at", "2016-10-07 11:15:00.929922"], ["id", 2]]
516
+  (0.0ms) RELEASE SAVEPOINT active_record_1
517
+ Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
518
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
519
+  (0.7ms) rollback transaction
520
+  (0.1ms) begin transaction
521
+ ------------------------
522
+ CategoryTest: test_truth
523
+ ------------------------
524
+  (0.1ms) rollback transaction
525
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
526
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
527
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
528
+  (0.1ms) begin transaction
529
+ --------------------------------------------------
530
+ PagePartsTest: test_shound_be_included_by_Category
531
+ --------------------------------------------------
532
+  (0.1ms) rollback transaction
533
+  (0.1ms) begin transaction
534
+ -------------------------
535
+ PagePartsTest: test_truth
536
+ -------------------------
537
+  (0.0ms) rollback transaction
538
+  (0.1ms) begin transaction
539
+ ----------------------------------------------------
540
+ CategoryTest: test_should_has_page_parts_definitions
541
+ ----------------------------------------------------
542
+  (0.1ms) rollback transaction
543
+  (0.1ms) begin transaction
544
+ -----------------------------------------------------
545
+ CategoryTest: test_should_load_page_parts_into_record
546
+ -----------------------------------------------------
547
+  (0.1ms) SAVEPOINT active_record_1
548
+ SQL (0.8ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:15:52.184987"], ["updated_at", "2016-10-07 11:15:52.184987"]]
549
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.191010"], ["updated_at", "2016-10-07 11:15:52.191010"]]
550
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.192423"], ["updated_at", "2016-10-07 11:15:52.192423"]]
551
+  (0.1ms) RELEASE SAVEPOINT active_record_1
552
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
553
+ PagePart Load (0.2ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
554
+  (0.4ms) rollback transaction
555
+  (0.1ms) begin transaction
556
+ -----------------------------------------------------------------
557
+ CategoryTest: test_should_raise_error_on_not_registered_page_part
558
+ -----------------------------------------------------------------
559
+  (0.1ms) rollback transaction
560
+  (0.1ms) begin transaction
561
+ ---------------------------------------------------------
562
+ CategoryTest: test_should_save_page_parts_with_new_record
563
+ ---------------------------------------------------------
564
+  (0.2ms) SELECT COUNT(*) FROM "page_parts"
565
+  (0.0ms) SAVEPOINT active_record_1
566
+ SQL (0.2ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:15:52.207683"], ["updated_at", "2016-10-07 11:15:52.207683"]]
567
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar content"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.208753"], ["updated_at", "2016-10-07 11:15:52.208753"]]
568
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.209839"], ["updated_at", "2016-10-07 11:15:52.209839"]]
569
+  (0.0ms) RELEASE SAVEPOINT active_record_1
570
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
571
+  (0.3ms) rollback transaction
572
+  (0.1ms) begin transaction
573
+ -------------------------------------------
574
+ CategoryTest: test_should_update_page_parts
575
+ -------------------------------------------
576
+  (0.1ms) SAVEPOINT active_record_1
577
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:15:52.214479"], ["updated_at", "2016-10-07 11:15:52.214479"]]
578
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.215868"], ["updated_at", "2016-10-07 11:15:52.215868"]]
579
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.217958"], ["updated_at", "2016-10-07 11:15:52.217958"]]
580
+  (0.1ms) RELEASE SAVEPOINT active_record_1
581
+ Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
582
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
583
+  (0.0ms) SAVEPOINT active_record_1
584
+ SQL (0.4ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Sidebar 2"], ["updated_at", "2016-10-07 11:15:52.221500"], ["id", 1]]
585
+ SQL (0.1ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Main 2"], ["updated_at", "2016-10-07 11:15:52.223459"], ["id", 2]]
586
+  (0.1ms) RELEASE SAVEPOINT active_record_1
587
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
588
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
589
+  (0.7ms) rollback transaction
590
+  (0.1ms) begin transaction
591
+ ------------------------
592
+ CategoryTest: test_truth
593
+ ------------------------
594
+  (0.1ms) rollback transaction
595
+  (0.0ms) begin transaction
596
+ ------------------------------------------------
597
+ PostTest: test_should_has_page_parts_definitions
598
+ ------------------------------------------------
599
+  (0.1ms) rollback transaction
600
+  (0.1ms) begin transaction
601
+ -------------------------------------------------
602
+ PostTest: test_should_load_page_parts_into_record
603
+ -------------------------------------------------
604
+  (0.1ms) SAVEPOINT active_record_1
605
+ SQL (0.3ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:15:52.243484"], ["updated_at", "2016-10-07 11:15:52.243484"]]
606
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.244739"], ["updated_at", "2016-10-07 11:15:52.244739"]]
607
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content_uk"], ["partable_type", "Post"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.245755"], ["updated_at", "2016-10-07 11:15:52.245755"]]
608
+  (0.1ms) RELEASE SAVEPOINT active_record_1
609
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", 1]]
610
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Post"]]
611
+  (0.4ms) rollback transaction
612
+  (0.1ms) begin transaction
613
+ -------------------------------------------------------------
614
+ PostTest: test_should_raise_error_on_not_registered_page_part
615
+ -------------------------------------------------------------
616
+  (0.1ms) rollback transaction
617
+  (0.1ms) begin transaction
618
+ -----------------------------------------------------
619
+ PostTest: test_should_save_page_parts_with_new_record
620
+ -----------------------------------------------------
621
+  (0.2ms) SELECT COUNT(*) FROM "page_parts"
622
+  (0.0ms) SAVEPOINT active_record_1
623
+ SQL (0.3ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:15:52.255464"], ["updated_at", "2016-10-07 11:15:52.255464"]]
624
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Title ru"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.256811"], ["updated_at", "2016-10-07 11:15:52.256811"]]
625
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_en"], ["partable_type", "Post"], ["content", "Title en"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.257867"], ["updated_at", "2016-10-07 11:15:52.257867"]]
626
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content_ru"], ["partable_type", "Post"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.258962"], ["updated_at", "2016-10-07 11:15:52.258962"]]
627
+  (0.1ms) RELEASE SAVEPOINT active_record_1
628
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
629
+  (0.3ms) rollback transaction
630
+  (0.1ms) begin transaction
631
+ -----------------------------------------------------------------
632
+ PagePartTest: test_should_create_new_record_with_valid_attributes
633
+ -----------------------------------------------------------------
634
+  (0.1ms) SAVEPOINT active_record_1
635
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "somekey"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.262328"], ["updated_at", "2016-10-07 11:15:52.262328"]]
636
+  (0.0ms) RELEASE SAVEPOINT active_record_1
637
+  (0.3ms) rollback transaction
638
+  (0.1ms) begin transaction
639
+ -----------------------------------------------------
640
+ PagePartTest: test_should_not_be_valid_with_empty_key
641
+ -----------------------------------------------------
642
+  (0.1ms) rollback transaction
643
+  (0.1ms) begin transaction
644
+ --------------------------------------------------------
645
+ PagePartTest: test_should_not_be_valid_with_not_uniq_key
646
+ --------------------------------------------------------
647
+  (0.0ms) SAVEPOINT active_record_1
648
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "test"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:15:52.274568"], ["updated_at", "2016-10-07 11:15:52.274568"]]
649
+  (0.0ms) RELEASE SAVEPOINT active_record_1
650
+  (0.4ms) rollback transaction
651
+  (0.1ms) begin transaction
652
+ ------------------------
653
+ PagePartTest: test_truth
654
+ ------------------------
655
+  (0.1ms) rollback transaction
656
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
657
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
658
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
659
+  (0.1ms) begin transaction
660
+ ------------------------------------------------
661
+ PostTest: test_should_has_page_parts_definitions
662
+ ------------------------------------------------
663
+  (0.2ms) rollback transaction
664
+  (0.1ms) begin transaction
665
+ -------------------------------------------------
666
+ PostTest: test_should_load_page_parts_into_record
667
+ -------------------------------------------------
668
+  (0.1ms) SAVEPOINT active_record_1
669
+ SQL (0.7ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:16:46.287524"], ["updated_at", "2016-10-07 11:16:46.287524"]]
670
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.292256"], ["updated_at", "2016-10-07 11:16:46.292256"]]
671
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content_uk"], ["partable_type", "Post"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.293626"], ["updated_at", "2016-10-07 11:16:46.293626"]]
672
+  (0.1ms) RELEASE SAVEPOINT active_record_1
673
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", 1]]
674
+ PagePart Load (0.2ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Post"]]
675
+  (0.3ms) rollback transaction
676
+  (0.1ms) begin transaction
677
+ -------------------------------------------------------------
678
+ PostTest: test_should_raise_error_on_not_registered_page_part
679
+ -------------------------------------------------------------
680
+  (0.1ms) rollback transaction
681
+  (0.1ms) begin transaction
682
+ -----------------------------------------------------
683
+ PostTest: test_should_save_page_parts_with_new_record
684
+ -----------------------------------------------------
685
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
686
+  (0.0ms) SAVEPOINT active_record_1
687
+ SQL (0.2ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:16:46.309816"], ["updated_at", "2016-10-07 11:16:46.309816"]]
688
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Title ru"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.310922"], ["updated_at", "2016-10-07 11:16:46.310922"]]
689
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_en"], ["partable_type", "Post"], ["content", "Title en"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.312323"], ["updated_at", "2016-10-07 11:16:46.312323"]]
690
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content_ru"], ["partable_type", "Post"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.314114"], ["updated_at", "2016-10-07 11:16:46.314114"]]
691
+  (0.1ms) RELEASE SAVEPOINT active_record_1
692
+  (0.2ms) SELECT COUNT(*) FROM "page_parts"
693
+  (0.4ms) rollback transaction
694
+  (0.1ms) begin transaction
695
+ --------------------------------------------------
696
+ PagePartsTest: test_shound_be_included_by_Category
697
+ --------------------------------------------------
698
+  (0.1ms) rollback transaction
699
+  (0.1ms) begin transaction
700
+ -------------------------
701
+ PagePartsTest: test_truth
702
+ -------------------------
703
+  (0.0ms) rollback transaction
704
+  (0.0ms) begin transaction
705
+ ----------------------------------------------------
706
+ CategoryTest: test_should_has_page_parts_definitions
707
+ ----------------------------------------------------
708
+  (0.1ms) rollback transaction
709
+  (0.1ms) begin transaction
710
+ -----------------------------------------------------
711
+ CategoryTest: test_should_load_page_parts_into_record
712
+ -----------------------------------------------------
713
+  (0.1ms) SAVEPOINT active_record_1
714
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:16:46.329467"], ["updated_at", "2016-10-07 11:16:46.329467"]]
715
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.330725"], ["updated_at", "2016-10-07 11:16:46.330725"]]
716
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.331789"], ["updated_at", "2016-10-07 11:16:46.331789"]]
717
+  (0.0ms) RELEASE SAVEPOINT active_record_1
718
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
719
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
720
+  (0.4ms) rollback transaction
721
+  (0.1ms) begin transaction
722
+ -----------------------------------------------------------------
723
+ CategoryTest: test_should_raise_error_on_not_registered_page_part
724
+ -----------------------------------------------------------------
725
+  (0.1ms) rollback transaction
726
+  (0.1ms) begin transaction
727
+ ---------------------------------------------------------
728
+ CategoryTest: test_should_save_page_parts_with_new_record
729
+ ---------------------------------------------------------
730
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
731
+  (0.0ms) SAVEPOINT active_record_1
732
+ SQL (0.2ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:16:46.339461"], ["updated_at", "2016-10-07 11:16:46.339461"]]
733
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar content"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.340552"], ["updated_at", "2016-10-07 11:16:46.340552"]]
734
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.341854"], ["updated_at", "2016-10-07 11:16:46.341854"]]
735
+  (0.1ms) RELEASE SAVEPOINT active_record_1
736
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
737
+  (0.4ms) rollback transaction
738
+  (0.1ms) begin transaction
739
+ -------------------------------------------
740
+ CategoryTest: test_should_update_page_parts
741
+ -------------------------------------------
742
+  (0.1ms) SAVEPOINT active_record_1
743
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:16:46.346809"], ["updated_at", "2016-10-07 11:16:46.346809"]]
744
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.348481"], ["updated_at", "2016-10-07 11:16:46.348481"]]
745
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.350560"], ["updated_at", "2016-10-07 11:16:46.350560"]]
746
+  (0.1ms) RELEASE SAVEPOINT active_record_1
747
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
748
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
749
+  (0.1ms) SAVEPOINT active_record_1
750
+ SQL (0.4ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Sidebar 2"], ["updated_at", "2016-10-07 11:16:46.354664"], ["id", 1]]
751
+ SQL (0.2ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Main 2"], ["updated_at", "2016-10-07 11:16:46.357390"], ["id", 2]]
752
+  (0.3ms) RELEASE SAVEPOINT active_record_1
753
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
754
+ PagePart Load (0.3ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
755
+  (0.9ms) rollback transaction
756
+  (0.1ms) begin transaction
757
+ ------------------------
758
+ CategoryTest: test_truth
759
+ ------------------------
760
+  (0.1ms) rollback transaction
761
+  (0.1ms) begin transaction
762
+ -----------------------------------------------------------------
763
+ PagePartTest: test_should_create_new_record_with_valid_attributes
764
+ -----------------------------------------------------------------
765
+  (0.0ms) SAVEPOINT active_record_1
766
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "somekey"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:16:46.372302"], ["updated_at", "2016-10-07 11:16:46.372302"]]
767
+  (0.1ms) RELEASE SAVEPOINT active_record_1
768
+  (0.4ms) rollback transaction
769
+  (0.1ms) begin transaction
770
+ -----------------------------------------------------
771
+ PagePartTest: test_should_not_be_valid_with_blank_key
772
+ -----------------------------------------------------
773
+  (0.1ms) rollback transaction
774
+  (0.1ms) begin transaction
775
+ -----------------------------------------------------
776
+ PagePartTest: test_should_not_be_valid_with_empty_key
777
+ -----------------------------------------------------
778
+  (0.0ms) rollback transaction
779
+  (0.1ms) begin transaction
780
+ ------------------------
781
+ PagePartTest: test_truth
782
+ ------------------------
783
+  (0.0ms) rollback transaction
784
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
785
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
786
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
787
+  (0.1ms) begin transaction
788
+ ----------------------------------------------------
789
+ CategoryTest: test_should_has_page_parts_definitions
790
+ ----------------------------------------------------
791
+  (0.1ms) rollback transaction
792
+  (0.1ms) begin transaction
793
+ -----------------------------------------------------
794
+ CategoryTest: test_should_load_page_parts_into_record
795
+ -----------------------------------------------------
796
+  (0.1ms) SAVEPOINT active_record_1
797
+ SQL (0.7ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:41:42.810799"], ["updated_at", "2016-10-07 11:41:42.810799"]]
798
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.815549"], ["updated_at", "2016-10-07 11:41:42.815549"]]
799
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.817002"], ["updated_at", "2016-10-07 11:41:42.817002"]]
800
+  (0.2ms) RELEASE SAVEPOINT active_record_1
801
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
802
+ PagePart Load (0.2ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
803
+  (0.9ms) rollback transaction
804
+  (0.1ms) begin transaction
805
+ -----------------------------------------------------------------
806
+ CategoryTest: test_should_raise_error_on_not_registered_page_part
807
+ -----------------------------------------------------------------
808
+  (0.1ms) rollback transaction
809
+  (0.1ms) begin transaction
810
+ ---------------------------------------------------------
811
+ CategoryTest: test_should_save_page_parts_with_new_record
812
+ ---------------------------------------------------------
813
+  (0.2ms) SELECT COUNT(*) FROM "page_parts"
814
+  (0.1ms) SAVEPOINT active_record_1
815
+ SQL (0.2ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:41:42.839735"], ["updated_at", "2016-10-07 11:41:42.839735"]]
816
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar content"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.840851"], ["updated_at", "2016-10-07 11:41:42.840851"]]
817
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.841923"], ["updated_at", "2016-10-07 11:41:42.841923"]]
818
+  (0.1ms) RELEASE SAVEPOINT active_record_1
819
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
820
+  (0.6ms) rollback transaction
821
+  (0.1ms) begin transaction
822
+ -------------------------------------------
823
+ CategoryTest: test_should_update_page_parts
824
+ -------------------------------------------
825
+  (0.1ms) SAVEPOINT active_record_1
826
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 11:41:42.847612"], ["updated_at", "2016-10-07 11:41:42.847612"]]
827
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.849057"], ["updated_at", "2016-10-07 11:41:42.849057"]]
828
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.850153"], ["updated_at", "2016-10-07 11:41:42.850153"]]
829
+  (0.1ms) RELEASE SAVEPOINT active_record_1
830
+ Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
831
+ PagePart Load (0.0ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
832
+  (0.0ms) SAVEPOINT active_record_1
833
+ SQL (0.5ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Sidebar 2"], ["updated_at", "2016-10-07 11:41:42.853669"], ["id", 1]]
834
+ SQL (0.1ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Main 2"], ["updated_at", "2016-10-07 11:41:42.856083"], ["id", 2]]
835
+  (0.1ms) RELEASE SAVEPOINT active_record_1
836
+ Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
837
+ PagePart Load (0.0ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
838
+  (0.6ms) rollback transaction
839
+  (0.1ms) begin transaction
840
+ ------------------------
841
+ CategoryTest: test_truth
842
+ ------------------------
843
+  (0.1ms) rollback transaction
844
+  (0.0ms) begin transaction
845
+ --------------------------------------------------
846
+ PagePartsTest: test_shound_be_included_by_Category
847
+ --------------------------------------------------
848
+  (0.0ms) rollback transaction
849
+  (0.1ms) begin transaction
850
+ -------------------------
851
+ PagePartsTest: test_truth
852
+ -------------------------
853
+  (0.0ms) rollback transaction
854
+  (0.0ms) begin transaction
855
+ -----------------------------------------------------------------
856
+ PagePartTest: test_should_create_new_record_with_valid_attributes
857
+ -----------------------------------------------------------------
858
+  (0.0ms) SAVEPOINT active_record_1
859
+ SQL (0.3ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "somekey"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.863412"], ["updated_at", "2016-10-07 11:41:42.863412"]]
860
+  (0.1ms) RELEASE SAVEPOINT active_record_1
861
+  (0.3ms) rollback transaction
862
+  (0.3ms) begin transaction
863
+ -----------------------------------------------------
864
+ PagePartTest: test_should_not_be_valid_with_blank_key
865
+ -----------------------------------------------------
866
+  (0.1ms) rollback transaction
867
+  (0.1ms) begin transaction
868
+ -----------------------------------------------------
869
+ PagePartTest: test_should_not_be_valid_with_empty_key
870
+ -----------------------------------------------------
871
+  (0.1ms) rollback transaction
872
+  (0.1ms) begin transaction
873
+ ------------------------
874
+ PagePartTest: test_truth
875
+ ------------------------
876
+  (0.0ms) rollback transaction
877
+  (0.0ms) begin transaction
878
+ ------------------------------------------------
879
+ PostTest: test_should_has_page_parts_definitions
880
+ ------------------------------------------------
881
+  (0.1ms) rollback transaction
882
+  (0.1ms) begin transaction
883
+ -------------------------------------------------
884
+ PostTest: test_should_load_page_parts_into_record
885
+ -------------------------------------------------
886
+  (0.1ms) SAVEPOINT active_record_1
887
+ SQL (0.3ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:41:42.888062"], ["updated_at", "2016-10-07 11:41:42.888062"]]
888
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.889256"], ["updated_at", "2016-10-07 11:41:42.889256"]]
889
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content_uk"], ["partable_type", "Post"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.890386"], ["updated_at", "2016-10-07 11:41:42.890386"]]
890
+  (0.1ms) RELEASE SAVEPOINT active_record_1
891
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", 1]]
892
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Post"]]
893
+  (0.4ms) rollback transaction
894
+  (0.1ms) begin transaction
895
+ -------------------------------------------------------------
896
+ PostTest: test_should_raise_error_on_not_registered_page_part
897
+ -------------------------------------------------------------
898
+  (0.0ms) rollback transaction
899
+  (0.1ms) begin transaction
900
+ -----------------------------------------------------
901
+ PostTest: test_should_save_page_parts_with_new_record
902
+ -----------------------------------------------------
903
+  (0.2ms) SELECT COUNT(*) FROM "page_parts"
904
+  (0.1ms) SAVEPOINT active_record_1
905
+ SQL (0.2ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 11:41:42.901761"], ["updated_at", "2016-10-07 11:41:42.901761"]]
906
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Title ru"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.903139"], ["updated_at", "2016-10-07 11:41:42.903139"]]
907
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_en"], ["partable_type", "Post"], ["content", "Title en"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.904243"], ["updated_at", "2016-10-07 11:41:42.904243"]]
908
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content_ru"], ["partable_type", "Post"], ["partable_id", 1], ["created_at", "2016-10-07 11:41:42.905139"], ["updated_at", "2016-10-07 11:41:42.905139"]]
909
+  (0.1ms) RELEASE SAVEPOINT active_record_1
910
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
911
+  (0.5ms) rollback transaction
912
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
913
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
914
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
915
+  (0.1ms) begin transaction
916
+ -----------------------------------------------------------------
917
+ PagePartTest: test_should_create_new_record_with_valid_attributes
918
+ -----------------------------------------------------------------
919
+  (0.1ms) SAVEPOINT active_record_1
920
+ SQL (0.8ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "somekey"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.022708"], ["updated_at", "2016-10-07 12:44:01.022708"]]
921
+  (0.1ms) RELEASE SAVEPOINT active_record_1
922
+  (2.0ms) rollback transaction
923
+  (0.1ms) begin transaction
924
+ -----------------------------------------------------
925
+ PagePartTest: test_should_not_be_valid_with_blank_key
926
+ -----------------------------------------------------
927
+  (0.1ms) rollback transaction
928
+  (0.1ms) begin transaction
929
+ -----------------------------------------------------
930
+ PagePartTest: test_should_not_be_valid_with_empty_key
931
+ -----------------------------------------------------
932
+  (0.1ms) rollback transaction
933
+  (0.1ms) begin transaction
934
+ ------------------------
935
+ PagePartTest: test_truth
936
+ ------------------------
937
+  (0.1ms) rollback transaction
938
+  (0.2ms) begin transaction
939
+ ----------------------------------------------------
940
+ CategoryTest: test_should_has_page_parts_definitions
941
+ ----------------------------------------------------
942
+  (0.1ms) rollback transaction
943
+  (0.1ms) begin transaction
944
+ -----------------------------------------------------
945
+ CategoryTest: test_should_load_page_parts_into_record
946
+ -----------------------------------------------------
947
+  (0.1ms) SAVEPOINT active_record_1
948
+ SQL (0.3ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 12:44:01.076354"], ["updated_at", "2016-10-07 12:44:01.076354"]]
949
+ SQL (0.2ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.077714"], ["updated_at", "2016-10-07 12:44:01.077714"]]
950
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.079179"], ["updated_at", "2016-10-07 12:44:01.079179"]]
951
+  (0.1ms) RELEASE SAVEPOINT active_record_1
952
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
953
+ PagePart Load (0.2ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
954
+  (0.4ms) rollback transaction
955
+  (0.1ms) begin transaction
956
+ -----------------------------------------------------------------
957
+ CategoryTest: test_should_raise_error_on_not_registered_page_part
958
+ -----------------------------------------------------------------
959
+  (0.0ms) rollback transaction
960
+  (0.1ms) begin transaction
961
+ ---------------------------------------------------------
962
+ CategoryTest: test_should_save_page_parts_with_new_record
963
+ ---------------------------------------------------------
964
+  (0.2ms) SELECT COUNT(*) FROM "page_parts"
965
+  (0.0ms) SAVEPOINT active_record_1
966
+ SQL (0.2ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 12:44:01.094298"], ["updated_at", "2016-10-07 12:44:01.094298"]]
967
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar content"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.095373"], ["updated_at", "2016-10-07 12:44:01.095373"]]
968
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.096400"], ["updated_at", "2016-10-07 12:44:01.096400"]]
969
+  (0.1ms) RELEASE SAVEPOINT active_record_1
970
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
971
+  (0.5ms) rollback transaction
972
+  (0.1ms) begin transaction
973
+ -------------------------------------------
974
+ CategoryTest: test_should_update_page_parts
975
+ -------------------------------------------
976
+  (0.1ms) SAVEPOINT active_record_1
977
+ SQL (0.5ms) INSERT INTO "categories" ("title", "created_at", "updated_at") VALUES (?, ?, ?) [["title", "Test category"], ["created_at", "2016-10-07 12:44:01.103068"], ["updated_at", "2016-10-07 12:44:01.103068"]]
978
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "sidebar"], ["partable_type", "Category"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.104481"], ["updated_at", "2016-10-07 12:44:01.104481"]]
979
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content"], ["partable_type", "Category"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.105528"], ["updated_at", "2016-10-07 12:44:01.105528"]]
980
+  (0.1ms) RELEASE SAVEPOINT active_record_1
981
+ Category Load (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
982
+ PagePart Load (0.0ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
983
+  (0.0ms) SAVEPOINT active_record_1
984
+ SQL (0.4ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Sidebar 2"], ["updated_at", "2016-10-07 12:44:01.108992"], ["id", 1]]
985
+ SQL (0.1ms) UPDATE "page_parts" SET "content" = ?, "updated_at" = ? WHERE "page_parts"."id" = ? [["content", "Main 2"], ["updated_at", "2016-10-07 12:44:01.111114"], ["id", 2]]
986
+  (0.0ms) RELEASE SAVEPOINT active_record_1
987
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
988
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Category"]]
989
+  (8.0ms) rollback transaction
990
+  (0.1ms) begin transaction
991
+ ------------------------
992
+ CategoryTest: test_truth
993
+ ------------------------
994
+  (0.0ms) rollback transaction
995
+  (0.1ms) begin transaction
996
+ --------------------------------------------------
997
+ PagePartsTest: test_shound_be_included_by_Category
998
+ --------------------------------------------------
999
+  (0.0ms) rollback transaction
1000
+  (0.1ms) begin transaction
1001
+ -------------------------
1002
+ PagePartsTest: test_truth
1003
+ -------------------------
1004
+  (0.1ms) rollback transaction
1005
+  (0.1ms) begin transaction
1006
+ ------------------------------------------------
1007
+ PostTest: test_should_has_page_parts_definitions
1008
+ ------------------------------------------------
1009
+  (0.1ms) rollback transaction
1010
+  (0.1ms) begin transaction
1011
+ -------------------------------------------------
1012
+ PostTest: test_should_load_page_parts_into_record
1013
+ -------------------------------------------------
1014
+  (0.1ms) SAVEPOINT active_record_1
1015
+ SQL (1.0ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 12:44:01.136499"], ["updated_at", "2016-10-07 12:44:01.136499"]]
1016
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Sidebar"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.138572"], ["updated_at", "2016-10-07 12:44:01.138572"]]
1017
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "content_uk"], ["partable_type", "Post"], ["content", "Main"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.139711"], ["updated_at", "2016-10-07 12:44:01.139711"]]
1018
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1019
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", 1]]
1020
+ PagePart Load (0.1ms) SELECT "page_parts".* FROM "page_parts" WHERE "page_parts"."partable_id" = ? AND "page_parts"."partable_type" = ? [["partable_id", 1], ["partable_type", "Post"]]
1021
+  (8.1ms) rollback transaction
1022
+  (0.1ms) begin transaction
1023
+ -------------------------------------------------------------
1024
+ PostTest: test_should_raise_error_on_not_registered_page_part
1025
+ -------------------------------------------------------------
1026
+  (0.1ms) rollback transaction
1027
+  (0.1ms) begin transaction
1028
+ -----------------------------------------------------
1029
+ PostTest: test_should_save_page_parts_with_new_record
1030
+ -----------------------------------------------------
1031
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
1032
+  (0.0ms) SAVEPOINT active_record_1
1033
+ SQL (0.6ms) INSERT INTO "posts" ("is_visible", "created_at", "updated_at") VALUES (?, ?, ?) [["is_visible", "t"], ["created_at", "2016-10-07 12:44:01.156723"], ["updated_at", "2016-10-07 12:44:01.156723"]]
1034
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_ru"], ["partable_type", "Post"], ["content", "Title ru"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.158260"], ["updated_at", "2016-10-07 12:44:01.158260"]]
1035
+ SQL (0.1ms) INSERT INTO "page_parts" ("key", "partable_type", "content", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["key", "title_en"], ["partable_type", "Post"], ["content", "Title en"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.159347"], ["updated_at", "2016-10-07 12:44:01.159347"]]
1036
+ SQL (0.0ms) INSERT INTO "page_parts" ("key", "partable_type", "partable_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["key", "content_ru"], ["partable_type", "Post"], ["partable_id", 1], ["created_at", "2016-10-07 12:44:01.160251"], ["updated_at", "2016-10-07 12:44:01.160251"]]
1037
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1038
+  (0.1ms) SELECT COUNT(*) FROM "page_parts"
1039
+  (0.4ms) rollback transaction