acts_as_slugable 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +56 -0
- data/Rakefile +29 -0
- data/lib/acts_as_slugable.rb +91 -0
- data/lib/acts_as_slugable/version.rb +3 -0
- data/lib/tasks/slugable_tasks.rake +4 -0
- data/test/database.yml +3 -0
- data/test/debug.log +293 -0
- data/test/fixtures/page.rb +4 -0
- data/test/schema.rb +7 -0
- data/test/slugable_test.rb +101 -0
- data/test/test_helper.rb +31 -0
- metadata +104 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 80110bad591bcd25acb0b28037087a883b3e53c9a2a90a1a67b87c13ea57c23b
|
4
|
+
data.tar.gz: 6fcfd2619b7b7aac5d8196bd726ca9fad562a3c526d4d78c90fb58ecf630a486
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d68c16da042d33e5bde332ceea03a7316c0bbf99329c81103aff854d238a0f98bf2ec0675107a73afbf85d09d3419f181ba4c142829028ccf0dbe29be96e314f
|
7
|
+
data.tar.gz: 2b2c8658b6ac15ad4481d06164ad0b901f1a13f7995bc16b8a591dc8b24d618a0ddcd390f70388123a19382b83ba0240b8a8f4cf6149546ef607fd4b28b4f0cf
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2014 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
= Acts as slugable readme
|
2
|
+
|
3
|
+
Generates a URL slug based on a specific fields (e.g. title).
|
4
|
+
|
5
|
+
A url slug is a string derived from a specific field which can the be used in a URL. For instance, a page with the title <tt>My page</tt> would have a URL slug of <tt>my-page</tt>.
|
6
|
+
|
7
|
+
The slug is generated on save and create actions. If the field has an existing URL slug (like when editing an existing record) the URL slug is preserved.
|
8
|
+
|
9
|
+
URL slugs are unique within the specified scope (or all records if no scope is defined). If the slug already exists within the scope, <tt>-n</tt> is added (e.g. <tt>my-page-0</tt>, <tt>my-page-1</tt>, etc...
|
10
|
+
|
11
|
+
|
12
|
+
== Installation
|
13
|
+
Add this to your Gemfile:
|
14
|
+
|
15
|
+
<tt>gem 'acts_as_slugable', git: 'https://github.com/coding-bunny/acts_as_slugable.git', tag: "1.0.1"</tt>
|
16
|
+
|
17
|
+
|
18
|
+
== Usage examples
|
19
|
+
|
20
|
+
In your target table, add a column to hold the URL slug.
|
21
|
+
|
22
|
+
|
23
|
+
=== With scope
|
24
|
+
|
25
|
+
class Page < ActiveRecord::Base
|
26
|
+
acts_as_slugable :source_column => :title, :slug_column => :url_slug, :scope => :parent
|
27
|
+
end
|
28
|
+
|
29
|
+
=== Without scope
|
30
|
+
|
31
|
+
class Post < ActiveRecord::Base
|
32
|
+
acts_as_slugable :source_column => :title, :slug_column => :url_slug
|
33
|
+
end
|
34
|
+
|
35
|
+
=== A sample link
|
36
|
+
|
37
|
+
link_to @page.title, :action => 'show', :url_slug => @page.url_slug
|
38
|
+
|
39
|
+
|
40
|
+
== Testing
|
41
|
+
|
42
|
+
The unit tests for this plugin use an in-memory sqlite3 database (http://www.sqlite.org/).
|
43
|
+
|
44
|
+
To execute the unit tests run the default rake task (<tt>rake</tt>). To execute the unit tests but preserve to debug log run <tt>rake test</tt>.
|
45
|
+
|
46
|
+
== Credits
|
47
|
+
|
48
|
+
Created by Alex Dunae (http://dunae.ca/), 2006-09, though it takes a village to raise a plugin:
|
49
|
+
|
50
|
+
Thanks to Andrew White (http://pixeltrix.co.uk/) for fixing a conflict with <tt>acts_as_list</tt>.
|
51
|
+
|
52
|
+
Thanks to Philip Hallstrom (http://pjkh.com/) for pointing out some redundant code.
|
53
|
+
|
54
|
+
Thanks to Arne De Herdt (https://github.com/coding-bunny) for making this a gem.
|
55
|
+
|
56
|
+
Thanks to Isoptope (http://isotopedev.com/) on Stackoverflow for resolving the query Issue.
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'ActsAsSlugable'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
Bundler::GemHelper.install_tasks
|
18
|
+
|
19
|
+
require 'rake/testtask'
|
20
|
+
|
21
|
+
Rake::TestTask.new(:test) do |t|
|
22
|
+
t.libs << 'lib'
|
23
|
+
t.libs << 'test'
|
24
|
+
t.pattern = 'test/**/*_test.rb'
|
25
|
+
t.verbose = false
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
task default: :test
|
@@ -0,0 +1,91 @@
|
|
1
|
+
module Slugable
|
2
|
+
module ActsAsSlugable
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
after_validation :create_slug
|
7
|
+
end
|
8
|
+
|
9
|
+
module ClassMethods
|
10
|
+
def acts_as_slugable(options = {})
|
11
|
+
configuration = {source_column: 'name', slug_column: 'url_slug', scope: nil}
|
12
|
+
configuration.update(options) if options.is_a?(Hash)
|
13
|
+
|
14
|
+
configuration[:scope] = "#{configuration[:scope]}_id".intern if configuration[:scope].is_a?(Symbol) && configuration[:scope].to_s !~/_id$/
|
15
|
+
|
16
|
+
if configuration[:scope].is_a?(Symbol)
|
17
|
+
scope_condition_method = %(
|
18
|
+
def slug_scope_condition
|
19
|
+
if #{configuration[:scope].to_s}.nil?
|
20
|
+
"#{configuration[:scope].to_s} IS NULL"
|
21
|
+
else
|
22
|
+
"#{configuration[:scope].to_s} = \#{#{configuration[:scope].to_s}}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
)
|
26
|
+
elsif configuration[:scope].nil?
|
27
|
+
scope_condition_method = "def slug_scope_condition() \"1 = 1\" end"
|
28
|
+
else
|
29
|
+
scope_condition_method = "def slug_scope_condition() \"#{configuration[:scope]}\" end"
|
30
|
+
end
|
31
|
+
|
32
|
+
class_eval <<-EOV
|
33
|
+
include Slugable::ActsAsSlugable::LocalInstanceMethods
|
34
|
+
|
35
|
+
def acts_as_slugable_class
|
36
|
+
::#{self.name}
|
37
|
+
end
|
38
|
+
|
39
|
+
def source_column
|
40
|
+
"#{configuration[:source_column]}"
|
41
|
+
end
|
42
|
+
|
43
|
+
def slug_column
|
44
|
+
"#{configuration[:slug_column]}"
|
45
|
+
end
|
46
|
+
|
47
|
+
#{scope_condition_method}
|
48
|
+
EOV
|
49
|
+
|
50
|
+
include Slugable::ActsAsSlugable::LocalInstanceMethods
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
module LocalInstanceMethods
|
55
|
+
private
|
56
|
+
|
57
|
+
def create_slug
|
58
|
+
return if self.errors.count > 0
|
59
|
+
|
60
|
+
if self[slug_column].to_s.empty?
|
61
|
+
test_string = self[source_column]
|
62
|
+
|
63
|
+
proposed_slug = test_string.strip.downcase.gsub(/['"#\$,.!?%@()]+/, '')
|
64
|
+
proposed_slug = proposed_slug.gsub(/&/, 'and')
|
65
|
+
proposed_slug = proposed_slug.gsub(/[\W]+/, '-')
|
66
|
+
proposed_slug = proposed_slug.gsub(/-{2}/, '-')
|
67
|
+
|
68
|
+
suffix = ''
|
69
|
+
existing = true
|
70
|
+
|
71
|
+
acts_as_slugable_class.transaction do
|
72
|
+
while existing != nil
|
73
|
+
existing = acts_as_slugable_class.where(["#{slug_column} = ? and #{slug_scope_condition}", proposed_slug + suffix]).first
|
74
|
+
if existing
|
75
|
+
if suffix.empty?
|
76
|
+
suffix = "-0"
|
77
|
+
else
|
78
|
+
suffix.succ!
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
self[slug_column] = proposed_slug + suffix
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
ActiveRecord::Base.send(:include, Slugable::ActsAsSlugable)
|
data/test/database.yml
ADDED
data/test/debug.log
ADDED
@@ -0,0 +1,293 @@
|
|
1
|
+
# Logfile created on 2019-05-21 11:54:19 +0200 by logger.rb/44203
|
2
|
+
D, [2019-05-21T12:02:28.071939 #16166] DEBUG -- : [1m[36m (0.1ms)[0m [1mCREATE TABLE "pages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer, "title" varchar NOT NULL, "url_slug" varchar NOT NULL) [0m
|
3
|
+
D, [2019-05-21T12:02:28.079515 #16166] DEBUG -- : [1m[35m (0.1ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
4
|
+
D, [2019-05-21T12:02:28.079637 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mselect sqlite_version(*)[0m
|
5
|
+
D, [2019-05-21T12:02:28.080188 #16166] DEBUG -- : [1m[35m (0.4ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
6
|
+
D, [2019-05-21T12:02:28.080303 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
7
|
+
D, [2019-05-21T12:02:28.080397 #16166] DEBUG -- : [1m[35m (0.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
8
|
+
D, [2019-05-21T12:02:28.086537 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
9
|
+
D, [2019-05-21T12:02:28.088027 #16166] DEBUG -- : [1m[35mPage Load (0.1ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
10
|
+
D, [2019-05-21T12:02:28.089104 #16166] DEBUG -- : [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title"], ["url_slug", "title"]]
|
11
|
+
D, [2019-05-21T12:02:28.089256 #16166] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
12
|
+
D, [2019-05-21T12:02:28.089433 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
13
|
+
D, [2019-05-21T12:02:28.089686 #16166] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title-and-some-spaces' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
14
|
+
D, [2019-05-21T12:02:28.089876 #16166] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title and some spaces"], ["url_slug", "title-and-some-spaces"]]
|
15
|
+
D, [2019-05-21T12:02:28.089989 #16166] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
16
|
+
D, [2019-05-21T12:02:28.090125 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
17
|
+
D, [2019-05-21T12:02:28.090345 #16166] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title-with-dashes' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
18
|
+
D, [2019-05-21T12:02:28.090527 #16166] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title-with-dashes"], ["url_slug", "title-with-dashes"]]
|
19
|
+
D, [2019-05-21T12:02:28.090643 #16166] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
20
|
+
D, [2019-05-21T12:02:28.090780 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
21
|
+
D, [2019-05-21T12:02:28.091003 #16166] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title-with-symbols' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
22
|
+
D, [2019-05-21T12:02:28.091186 #16166] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title-with'-$#)(*%symbols"], ["url_slug", "title-with-symbols"]]
|
23
|
+
D, [2019-05-21T12:02:28.091299 #16166] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
24
|
+
D, [2019-05-21T12:02:28.091434 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
25
|
+
D, [2019-05-21T12:02:28.091706 #16166] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = '-urltitle-' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
26
|
+
D, [2019-05-21T12:02:28.091892 #16166] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "/urltitle/"], ["url_slug", "-urltitle-"]]
|
27
|
+
D, [2019-05-21T12:02:28.092001 #16166] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
28
|
+
D, [2019-05-21T12:02:28.092137 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
29
|
+
D, [2019-05-21T12:02:28.092426 #16166] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'calcul-en-fran-aise' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
30
|
+
D, [2019-05-21T12:02:28.092614 #16166] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "calculé en française"], ["url_slug", "calcul-en-fran-aise"]]
|
31
|
+
D, [2019-05-21T12:02:28.092724 #16166] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
32
|
+
D, [2019-05-21T12:02:28.092933 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
33
|
+
D, [2019-05-21T12:02:28.093159 #16166] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'new-page' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
34
|
+
D, [2019-05-21T12:02:28.093344 #16166] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "New Page"], ["url_slug", "new-page"]]
|
35
|
+
D, [2019-05-21T12:02:28.093454 #16166] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
36
|
+
D, [2019-05-21T12:02:28.093615 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
37
|
+
D, [2019-05-21T12:02:28.093800 #16166] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "Test override"], ["url_slug", "something-different"]]
|
38
|
+
D, [2019-05-21T12:02:28.093911 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
39
|
+
D, [2019-05-21T12:02:28.094112 #16166] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
40
|
+
D, [2019-05-21T12:02:28.099277 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
41
|
+
D, [2019-05-21T12:02:28.099907 #16166] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
42
|
+
D, [2019-05-21T12:02:28.100364 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
43
|
+
D, [2019-05-21T12:02:28.100959 #16166] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
44
|
+
D, [2019-05-21T12:02:28.101323 #16166] DEBUG -- : [1m[36mPage Load (0.1ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-scoped-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
45
|
+
D, [2019-05-21T12:02:28.101629 #16166] DEBUG -- : [1m[35mSQL (0.1ms)[0m INSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?) [["title", "Unique scoped title"], ["parent_id", 1], ["url_slug", "unique-scoped-title"]]
|
46
|
+
D, [2019-05-21T12:02:28.101766 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
47
|
+
D, [2019-05-21T12:02:28.101921 #16166] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
48
|
+
D, [2019-05-21T12:02:28.102164 #16166] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-scoped-title' and parent_id = 2) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
49
|
+
D, [2019-05-21T12:02:28.102363 #16166] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?) [["title", "Unique scoped title"], ["parent_id", 2], ["url_slug", "unique-scoped-title"]]
|
50
|
+
D, [2019-05-21T12:02:28.102477 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
51
|
+
D, [2019-05-21T12:02:28.102697 #16166] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
52
|
+
D, [2019-05-21T12:02:28.102928 #16166] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
53
|
+
D, [2019-05-21T12:02:28.103313 #16166] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?) [["title", "Unique title"], ["parent_id", 1], ["url_slug", "unique-title"]]
|
54
|
+
D, [2019-05-21T12:02:28.103426 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
55
|
+
D, [2019-05-21T12:02:28.107074 #16166] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
56
|
+
D, [2019-05-21T12:02:28.107702 #16166] DEBUG -- : [1m[36mPage Load (0.4ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
57
|
+
D, [2019-05-21T12:02:28.108276 #16166] DEBUG -- : [1m[35mPage Load (0.1ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title-0' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1
|
58
|
+
D, [2019-05-21T12:02:28.108536 #16166] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?)[0m [["title", "Unique title"], ["parent_id", 1], ["url_slug", "unique-title-0"]]
|
59
|
+
D, [2019-05-21T12:02:28.108667 #16166] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
60
|
+
D, [2019-05-21T12:02:28.108998 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
61
|
+
D, [2019-05-21T12:02:28.109423 #16166] DEBUG -- : [1m[35mPage Load (0.1ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'original-page' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
62
|
+
D, [2019-05-21T12:02:28.109631 #16166] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Original Page"], ["url_slug", "original-page"]]
|
63
|
+
D, [2019-05-21T12:02:28.109747 #16166] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
64
|
+
D, [2019-05-21T12:02:28.109870 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
65
|
+
D, [2019-05-21T12:02:28.111183 #16166] DEBUG -- : [1m[35mSQL (0.0ms)[0m UPDATE "pages" SET "title" = ? WHERE "pages"."id" = ? [["title", "Updated title only"], ["id", 13]]
|
66
|
+
D, [2019-05-21T12:02:28.111292 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
67
|
+
D, [2019-05-21T12:02:28.111366 #16166] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
68
|
+
D, [2019-05-21T12:02:28.111657 #16166] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'updated-title-and-slug-to-nil' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
69
|
+
D, [2019-05-21T12:02:28.111924 #16166] DEBUG -- : [1m[35mSQL (0.0ms)[0m UPDATE "pages" SET "title" = ?, "url_slug" = ? WHERE "pages"."id" = ? [["title", "Updated title and slug to nil"], ["url_slug", "updated-title-and-slug-to-nil"], ["id", 13]]
|
70
|
+
D, [2019-05-21T12:02:28.112019 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
71
|
+
D, [2019-05-21T12:02:28.112087 #16166] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
72
|
+
D, [2019-05-21T12:02:28.112350 #16166] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'updated-title-and-slug-to-empty' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
73
|
+
D, [2019-05-21T12:02:28.112586 #16166] DEBUG -- : [1m[35mSQL (0.0ms)[0m UPDATE "pages" SET "title" = ?, "url_slug" = ? WHERE "pages"."id" = ? [["title", "Updated title and slug to empty"], ["url_slug", "updated-title-and-slug-to-empty"], ["id", 13]]
|
74
|
+
D, [2019-05-21T12:02:28.112678 #16166] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
75
|
+
D, [2019-05-21T12:03:17.796707 #16267] DEBUG -- : [1m[36m (0.1ms)[0m [1mCREATE TABLE "pages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer, "title" varchar NOT NULL, "url_slug" varchar NOT NULL) [0m
|
76
|
+
D, [2019-05-21T12:03:17.809178 #16267] DEBUG -- : [1m[35m (0.1ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
77
|
+
D, [2019-05-21T12:03:17.809312 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mselect sqlite_version(*)[0m
|
78
|
+
D, [2019-05-21T12:03:17.809527 #16267] DEBUG -- : [1m[35m (0.1ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
79
|
+
D, [2019-05-21T12:03:17.809634 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
80
|
+
D, [2019-05-21T12:03:17.809718 #16267] DEBUG -- : [1m[35m (0.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
81
|
+
D, [2019-05-21T12:03:17.815519 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
82
|
+
D, [2019-05-21T12:03:17.816775 #16267] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
83
|
+
D, [2019-05-21T12:03:17.817673 #16267] DEBUG -- : [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title"], ["url_slug", "title"]]
|
84
|
+
D, [2019-05-21T12:03:17.817827 #16267] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
85
|
+
D, [2019-05-21T12:03:17.818006 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
86
|
+
D, [2019-05-21T12:03:17.818270 #16267] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title-and-some-spaces' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
87
|
+
D, [2019-05-21T12:03:17.818466 #16267] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title and some spaces"], ["url_slug", "title-and-some-spaces"]]
|
88
|
+
D, [2019-05-21T12:03:17.818578 #16267] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
89
|
+
D, [2019-05-21T12:03:17.818764 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
90
|
+
D, [2019-05-21T12:03:17.818990 #16267] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title-with-dashes' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
91
|
+
D, [2019-05-21T12:03:17.819175 #16267] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title-with-dashes"], ["url_slug", "title-with-dashes"]]
|
92
|
+
D, [2019-05-21T12:03:17.819286 #16267] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
93
|
+
D, [2019-05-21T12:03:17.819423 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
94
|
+
D, [2019-05-21T12:03:17.819645 #16267] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title-with-symbols' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
95
|
+
D, [2019-05-21T12:03:17.819828 #16267] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title-with'-$#)(*%symbols"], ["url_slug", "title-with-symbols"]]
|
96
|
+
D, [2019-05-21T12:03:17.819938 #16267] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
97
|
+
D, [2019-05-21T12:03:17.820074 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
98
|
+
D, [2019-05-21T12:03:17.820309 #16267] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = '-urltitle-' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
99
|
+
D, [2019-05-21T12:03:17.820495 #16267] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "/urltitle/"], ["url_slug", "-urltitle-"]]
|
100
|
+
D, [2019-05-21T12:03:17.820606 #16267] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
101
|
+
D, [2019-05-21T12:03:17.820742 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
102
|
+
D, [2019-05-21T12:03:17.821004 #16267] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'calcul-en-fran-aise' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
103
|
+
D, [2019-05-21T12:03:17.821190 #16267] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "calculé en française"], ["url_slug", "calcul-en-fran-aise"]]
|
104
|
+
D, [2019-05-21T12:03:17.821301 #16267] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
105
|
+
D, [2019-05-21T12:03:17.821521 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
106
|
+
D, [2019-05-21T12:03:17.821780 #16267] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'new-page' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
107
|
+
D, [2019-05-21T12:03:17.821972 #16267] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "New Page"], ["url_slug", "new-page"]]
|
108
|
+
D, [2019-05-21T12:03:17.822082 #16267] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
109
|
+
D, [2019-05-21T12:03:17.822289 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
110
|
+
D, [2019-05-21T12:03:17.822500 #16267] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "Test override"], ["url_slug", "something-different"]]
|
111
|
+
D, [2019-05-21T12:03:17.822611 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
112
|
+
D, [2019-05-21T12:03:17.822879 #16267] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
113
|
+
D, [2019-05-21T12:03:17.828097 #16267] DEBUG -- : [1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
114
|
+
D, [2019-05-21T12:03:17.828745 #16267] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
115
|
+
D, [2019-05-21T12:03:17.829182 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
116
|
+
D, [2019-05-21T12:03:17.829865 #16267] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
117
|
+
D, [2019-05-21T12:03:17.830234 #16267] DEBUG -- : [1m[36mPage Load (0.1ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-scoped-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
118
|
+
D, [2019-05-21T12:03:17.830543 #16267] DEBUG -- : [1m[35mSQL (0.1ms)[0m INSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?) [["title", "Unique scoped title"], ["parent_id", 1], ["url_slug", "unique-scoped-title"]]
|
119
|
+
D, [2019-05-21T12:03:17.830689 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
120
|
+
D, [2019-05-21T12:03:17.830846 #16267] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
121
|
+
D, [2019-05-21T12:03:17.831083 #16267] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-scoped-title' and parent_id = 2) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
122
|
+
D, [2019-05-21T12:03:17.831285 #16267] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?) [["title", "Unique scoped title"], ["parent_id", 2], ["url_slug", "unique-scoped-title"]]
|
123
|
+
D, [2019-05-21T12:03:17.831398 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
124
|
+
D, [2019-05-21T12:03:17.831668 #16267] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
125
|
+
D, [2019-05-21T12:03:17.831894 #16267] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
126
|
+
D, [2019-05-21T12:03:17.832092 #16267] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?) [["title", "Unique title"], ["parent_id", 1], ["url_slug", "unique-title"]]
|
127
|
+
D, [2019-05-21T12:03:17.832208 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
128
|
+
D, [2019-05-21T12:03:17.832355 #16267] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
129
|
+
D, [2019-05-21T12:03:17.832583 #16267] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
130
|
+
D, [2019-05-21T12:03:17.833052 #16267] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title-0' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1
|
131
|
+
D, [2019-05-21T12:03:17.833269 #16267] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?)[0m [["title", "Unique title"], ["parent_id", 1], ["url_slug", "unique-title-0"]]
|
132
|
+
D, [2019-05-21T12:03:17.833387 #16267] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
133
|
+
D, [2019-05-21T12:03:17.833647 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
134
|
+
D, [2019-05-21T12:03:17.833875 #16267] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'original-page' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
135
|
+
D, [2019-05-21T12:03:17.834062 #16267] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Original Page"], ["url_slug", "original-page"]]
|
136
|
+
D, [2019-05-21T12:03:17.834174 #16267] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
137
|
+
D, [2019-05-21T12:03:17.834297 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
138
|
+
D, [2019-05-21T12:03:17.835621 #16267] DEBUG -- : [1m[35mSQL (0.0ms)[0m UPDATE "pages" SET "title" = ? WHERE "pages"."id" = ? [["title", "Updated title only"], ["id", 13]]
|
139
|
+
D, [2019-05-21T12:03:17.835730 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
140
|
+
D, [2019-05-21T12:03:17.835804 #16267] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
141
|
+
D, [2019-05-21T12:03:17.836145 #16267] DEBUG -- : [1m[36mPage Load (0.1ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'updated-title-and-slug-to-nil' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
142
|
+
D, [2019-05-21T12:03:17.836422 #16267] DEBUG -- : [1m[35mSQL (0.0ms)[0m UPDATE "pages" SET "title" = ?, "url_slug" = ? WHERE "pages"."id" = ? [["title", "Updated title and slug to nil"], ["url_slug", "updated-title-and-slug-to-nil"], ["id", 13]]
|
143
|
+
D, [2019-05-21T12:03:17.836518 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
144
|
+
D, [2019-05-21T12:03:17.836589 #16267] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
145
|
+
D, [2019-05-21T12:03:17.836854 #16267] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'updated-title-and-slug-to-empty' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
146
|
+
D, [2019-05-21T12:03:17.837099 #16267] DEBUG -- : [1m[35mSQL (0.0ms)[0m UPDATE "pages" SET "title" = ?, "url_slug" = ? WHERE "pages"."id" = ? [["title", "Updated title and slug to empty"], ["url_slug", "updated-title-and-slug-to-empty"], ["id", 13]]
|
147
|
+
D, [2019-05-21T12:03:17.837192 #16267] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
148
|
+
D, [2019-05-21T12:03:55.278853 #16440] DEBUG -- : [1m[36m (0.1ms)[0m [1mCREATE TABLE "pages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer, "title" varchar NOT NULL, "url_slug" varchar NOT NULL) [0m
|
149
|
+
D, [2019-05-21T12:03:55.291052 #16440] DEBUG -- : [1m[35m (0.1ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
150
|
+
D, [2019-05-21T12:03:55.291191 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mselect sqlite_version(*)[0m
|
151
|
+
D, [2019-05-21T12:03:55.291406 #16440] DEBUG -- : [1m[35m (0.1ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
152
|
+
D, [2019-05-21T12:03:55.291515 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
153
|
+
D, [2019-05-21T12:03:55.291598 #16440] DEBUG -- : [1m[35m (0.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
154
|
+
D, [2019-05-21T12:03:55.297567 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
155
|
+
D, [2019-05-21T12:03:55.298899 #16440] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'new-page' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
156
|
+
D, [2019-05-21T12:03:55.299772 #16440] DEBUG -- : [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "New Page"], ["url_slug", "new-page"]]
|
157
|
+
D, [2019-05-21T12:03:55.299925 #16440] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
158
|
+
D, [2019-05-21T12:03:55.300251 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
159
|
+
D, [2019-05-21T12:03:55.300450 #16440] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "Test override"], ["url_slug", "something-different"]]
|
160
|
+
D, [2019-05-21T12:03:55.300562 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
161
|
+
D, [2019-05-21T12:03:55.300782 #16440] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
162
|
+
D, [2019-05-21T12:03:55.301038 #16440] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-scoped-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
163
|
+
D, [2019-05-21T12:03:55.301256 #16440] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?) [["title", "Unique scoped title"], ["parent_id", 1], ["url_slug", "unique-scoped-title"]]
|
164
|
+
D, [2019-05-21T12:03:55.301383 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
165
|
+
D, [2019-05-21T12:03:55.301529 #16440] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
166
|
+
D, [2019-05-21T12:03:55.301750 #16440] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-scoped-title' and parent_id = 2) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
167
|
+
D, [2019-05-21T12:03:55.301945 #16440] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?) [["title", "Unique scoped title"], ["parent_id", 2], ["url_slug", "unique-scoped-title"]]
|
168
|
+
D, [2019-05-21T12:03:55.302058 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
169
|
+
D, [2019-05-21T12:03:55.302247 #16440] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
170
|
+
D, [2019-05-21T12:03:55.302465 #16440] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
171
|
+
D, [2019-05-21T12:03:55.302718 #16440] DEBUG -- : [1m[35mSQL (0.1ms)[0m INSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?) [["title", "Unique title"], ["parent_id", 1], ["url_slug", "unique-title"]]
|
172
|
+
D, [2019-05-21T12:03:55.302833 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
173
|
+
D, [2019-05-21T12:03:55.302979 #16440] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
174
|
+
D, [2019-05-21T12:03:55.303200 #16440] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
175
|
+
D, [2019-05-21T12:03:55.303649 #16440] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title-0' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1
|
176
|
+
D, [2019-05-21T12:03:55.303861 #16440] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?)[0m [["title", "Unique title"], ["parent_id", 1], ["url_slug", "unique-title-0"]]
|
177
|
+
D, [2019-05-21T12:03:55.303975 #16440] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
178
|
+
D, [2019-05-21T12:03:55.304160 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
179
|
+
D, [2019-05-21T12:03:55.304377 #16440] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
180
|
+
D, [2019-05-21T12:03:55.304560 #16440] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title"], ["url_slug", "title"]]
|
181
|
+
D, [2019-05-21T12:03:55.304670 #16440] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
182
|
+
D, [2019-05-21T12:03:55.304810 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
183
|
+
D, [2019-05-21T12:03:55.305029 #16440] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title-and-some-spaces' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
184
|
+
D, [2019-05-21T12:03:55.305212 #16440] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title and some spaces"], ["url_slug", "title-and-some-spaces"]]
|
185
|
+
D, [2019-05-21T12:03:55.305321 #16440] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
186
|
+
D, [2019-05-21T12:03:55.305458 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
187
|
+
D, [2019-05-21T12:03:55.305675 #16440] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title-with-dashes' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
188
|
+
D, [2019-05-21T12:03:55.305855 #16440] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title-with-dashes"], ["url_slug", "title-with-dashes"]]
|
189
|
+
D, [2019-05-21T12:03:55.305964 #16440] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
190
|
+
D, [2019-05-21T12:03:55.306110 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
191
|
+
D, [2019-05-21T12:03:55.306328 #16440] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'title-with-symbols' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
192
|
+
D, [2019-05-21T12:03:55.306510 #16440] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Title-with'-$#)(*%symbols"], ["url_slug", "title-with-symbols"]]
|
193
|
+
D, [2019-05-21T12:03:55.306619 #16440] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
194
|
+
D, [2019-05-21T12:03:55.306761 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
195
|
+
D, [2019-05-21T12:03:55.306977 #16440] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = '-urltitle-' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
196
|
+
D, [2019-05-21T12:03:55.307158 #16440] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "/urltitle/"], ["url_slug", "-urltitle-"]]
|
197
|
+
D, [2019-05-21T12:03:55.307266 #16440] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
198
|
+
D, [2019-05-21T12:03:55.307401 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
199
|
+
D, [2019-05-21T12:03:55.307648 #16440] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'calcul-en-fran-aise' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
200
|
+
D, [2019-05-21T12:03:55.307829 #16440] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "calculé en française"], ["url_slug", "calcul-en-fran-aise"]]
|
201
|
+
D, [2019-05-21T12:03:55.307937 #16440] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
202
|
+
D, [2019-05-21T12:03:55.308117 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
203
|
+
D, [2019-05-21T12:03:55.308547 #16440] DEBUG -- : [1m[35mPage Load (0.2ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'original-page' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
204
|
+
D, [2019-05-21T12:03:55.308742 #16440] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "Original Page"], ["url_slug", "original-page"]]
|
205
|
+
D, [2019-05-21T12:03:55.308855 #16440] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
206
|
+
D, [2019-05-21T12:03:55.308979 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
207
|
+
D, [2019-05-21T12:03:55.310393 #16440] DEBUG -- : [1m[35mSQL (0.0ms)[0m UPDATE "pages" SET "title" = ? WHERE "pages"."id" = ? [["title", "Updated title only"], ["id", 13]]
|
208
|
+
D, [2019-05-21T12:03:55.310501 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
209
|
+
D, [2019-05-21T12:03:55.310577 #16440] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
210
|
+
D, [2019-05-21T12:03:55.310891 #16440] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'updated-title-and-slug-to-nil' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
211
|
+
D, [2019-05-21T12:03:55.311164 #16440] DEBUG -- : [1m[35mSQL (0.0ms)[0m UPDATE "pages" SET "title" = ?, "url_slug" = ? WHERE "pages"."id" = ? [["title", "Updated title and slug to nil"], ["url_slug", "updated-title-and-slug-to-nil"], ["id", 13]]
|
212
|
+
D, [2019-05-21T12:03:55.311259 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
213
|
+
D, [2019-05-21T12:03:55.311327 #16440] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
214
|
+
D, [2019-05-21T12:03:55.311664 #16440] DEBUG -- : [1m[36mPage Load (0.1ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'updated-title-and-slug-to-empty' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
215
|
+
D, [2019-05-21T12:03:55.311911 #16440] DEBUG -- : [1m[35mSQL (0.0ms)[0m UPDATE "pages" SET "title" = ?, "url_slug" = ? WHERE "pages"."id" = ? [["title", "Updated title and slug to empty"], ["url_slug", "updated-title-and-slug-to-empty"], ["id", 13]]
|
216
|
+
D, [2019-05-21T12:03:55.312022 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
217
|
+
D, [2019-05-21T12:03:55.312314 #16440] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
218
|
+
D, [2019-05-21T12:03:55.317584 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
219
|
+
D, [2019-05-21T12:03:55.318272 #16440] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
220
|
+
D, [2019-05-21T12:03:55.318887 #16440] DEBUG -- : [1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
221
|
+
D, [2019-11-12T09:48:22.354500 #25223] DEBUG -- : [1m[36m (0.1ms)[0m [1mCREATE TABLE "pages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer, "title" varchar NOT NULL, "url_slug" varchar NOT NULL) [0m
|
222
|
+
D, [2019-11-12T09:48:22.367430 #25223] DEBUG -- : [1m[35m (0.1ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
223
|
+
D, [2019-11-12T09:48:22.367551 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mselect sqlite_version(*)[0m
|
224
|
+
D, [2019-11-12T09:48:22.367793 #25223] DEBUG -- : [1m[35m (0.1ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
225
|
+
D, [2019-11-12T09:48:22.367896 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
226
|
+
D, [2019-11-12T09:48:22.367973 #25223] DEBUG -- : [1m[35m (0.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
227
|
+
D, [2019-11-12T09:48:22.374085 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
228
|
+
D, [2019-11-12T09:48:22.386888 #25223] DEBUG -- : [1m[35m (0.0ms)[0m rollback transaction
|
229
|
+
D, [2019-11-12T09:48:22.387525 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
230
|
+
D, [2019-11-12T09:48:22.387980 #25223] DEBUG -- : [1m[35m (0.0ms)[0m rollback transaction
|
231
|
+
D, [2019-11-12T09:48:22.388562 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
232
|
+
D, [2019-11-12T09:48:22.389104 #25223] DEBUG -- : [1m[35mPage Load (0.1ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-scoped-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1
|
233
|
+
D, [2019-11-12T09:48:22.390667 #25223] DEBUG -- : [1m[36mSQL (0.1ms)[0m [1mINSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?)[0m [["title", "Unique scoped title"], ["parent_id", 1], ["url_slug", "unique-scoped-title"]]
|
234
|
+
D, [2019-11-12T09:48:22.390810 #25223] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
235
|
+
D, [2019-11-12T09:48:22.390970 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
236
|
+
D, [2019-11-12T09:48:22.391214 #25223] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-scoped-title' and parent_id = 2) ORDER BY "pages"."id" ASC LIMIT 1
|
237
|
+
D, [2019-11-12T09:48:22.391413 #25223] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?)[0m [["title", "Unique scoped title"], ["parent_id", 2], ["url_slug", "unique-scoped-title"]]
|
238
|
+
D, [2019-11-12T09:48:22.391521 #25223] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
239
|
+
D, [2019-11-12T09:48:22.391761 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
240
|
+
D, [2019-11-12T09:48:22.391983 #25223] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1
|
241
|
+
D, [2019-11-12T09:48:22.392178 #25223] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?)[0m [["title", "Unique title"], ["parent_id", 1], ["url_slug", "unique-title"]]
|
242
|
+
D, [2019-11-12T09:48:22.392284 #25223] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
243
|
+
D, [2019-11-12T09:48:22.392426 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
244
|
+
D, [2019-11-12T09:48:22.392643 #25223] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1
|
245
|
+
D, [2019-11-12T09:48:22.394030 #25223] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'unique-title-0' and parent_id = 1) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
246
|
+
D, [2019-11-12T09:48:22.394245 #25223] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "parent_id", "url_slug") VALUES (?, ?, ?) [["title", "Unique title"], ["parent_id", 1], ["url_slug", "unique-title-0"]]
|
247
|
+
D, [2019-11-12T09:48:22.394357 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
248
|
+
D, [2019-11-12T09:48:22.394570 #25223] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
249
|
+
D, [2019-11-12T09:48:22.394792 #25223] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'original-page' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
250
|
+
D, [2019-11-12T09:48:22.394993 #25223] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "Original Page"], ["url_slug", "original-page"]]
|
251
|
+
D, [2019-11-12T09:48:22.395101 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
252
|
+
D, [2019-11-12T09:48:22.395217 #25223] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
253
|
+
D, [2019-11-12T09:48:22.397155 #25223] DEBUG -- : [1m[36mSQL (0.1ms)[0m [1mUPDATE "pages" SET "title" = ? WHERE "pages"."id" = ?[0m [["title", "Updated title only"], ["id", 5]]
|
254
|
+
D, [2019-11-12T09:48:22.397265 #25223] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
255
|
+
D, [2019-11-12T09:48:22.397338 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
256
|
+
D, [2019-11-12T09:48:22.397644 #25223] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'updated-title-and-slug-to-nil' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
257
|
+
D, [2019-11-12T09:48:22.397914 #25223] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mUPDATE "pages" SET "title" = ?, "url_slug" = ? WHERE "pages"."id" = ?[0m [["title", "Updated title and slug to nil"], ["url_slug", "updated-title-and-slug-to-nil"], ["id", 5]]
|
258
|
+
D, [2019-11-12T09:48:22.398004 #25223] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
259
|
+
D, [2019-11-12T09:48:22.398068 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
260
|
+
D, [2019-11-12T09:48:22.398328 #25223] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'updated-title-and-slug-to-empty' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
261
|
+
D, [2019-11-12T09:48:22.398560 #25223] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mUPDATE "pages" SET "title" = ?, "url_slug" = ? WHERE "pages"."id" = ?[0m [["title", "Updated title and slug to empty"], ["url_slug", "updated-title-and-slug-to-empty"], ["id", 5]]
|
262
|
+
D, [2019-11-12T09:48:22.398648 #25223] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
263
|
+
D, [2019-11-12T09:48:22.398822 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
264
|
+
D, [2019-11-12T09:48:22.399045 #25223] DEBUG -- : [1m[35mPage Load (0.0ms)[0m SELECT "pages".* FROM "pages" WHERE (url_slug = 'new-page' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1
|
265
|
+
D, [2019-11-12T09:48:22.399237 #25223] DEBUG -- : [1m[36mSQL (0.0ms)[0m [1mINSERT INTO "pages" ("title", "url_slug") VALUES (?, ?)[0m [["title", "New Page"], ["url_slug", "new-page"]]
|
266
|
+
D, [2019-11-12T09:48:22.399345 #25223] DEBUG -- : [1m[35m (0.0ms)[0m commit transaction
|
267
|
+
D, [2019-11-12T09:48:22.399504 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
268
|
+
D, [2019-11-12T09:48:22.399726 #25223] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "Test override"], ["url_slug", "something-different"]]
|
269
|
+
D, [2019-11-12T09:48:22.399835 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
270
|
+
D, [2019-11-12T09:48:22.400006 #25223] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
271
|
+
D, [2019-11-12T09:48:22.400227 #25223] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'title' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
272
|
+
D, [2019-11-12T09:48:22.400412 #25223] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "Title"], ["url_slug", "title"]]
|
273
|
+
D, [2019-11-12T09:48:22.400518 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
274
|
+
D, [2019-11-12T09:48:22.400652 #25223] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
275
|
+
D, [2019-11-12T09:48:22.400871 #25223] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'title-and-some-spaces' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
276
|
+
D, [2019-11-12T09:48:22.401049 #25223] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "Title and some spaces"], ["url_slug", "title-and-some-spaces"]]
|
277
|
+
D, [2019-11-12T09:48:22.401154 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
278
|
+
D, [2019-11-12T09:48:22.401284 #25223] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
279
|
+
D, [2019-11-12T09:48:22.401501 #25223] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'title-with-dashes' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
280
|
+
D, [2019-11-12T09:48:22.401678 #25223] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "Title-with-dashes"], ["url_slug", "title-with-dashes"]]
|
281
|
+
D, [2019-11-12T09:48:22.401783 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
282
|
+
D, [2019-11-12T09:48:22.401912 #25223] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
283
|
+
D, [2019-11-12T09:48:22.402130 #25223] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'title-with-symbols' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
284
|
+
D, [2019-11-12T09:48:22.402309 #25223] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "Title-with'-$#)(*%symbols"], ["url_slug", "title-with-symbols"]]
|
285
|
+
D, [2019-11-12T09:48:22.402413 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
286
|
+
D, [2019-11-12T09:48:22.402542 #25223] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
287
|
+
D, [2019-11-12T09:48:22.402756 #25223] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = '-urltitle-' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
288
|
+
D, [2019-11-12T09:48:22.402934 #25223] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "/urltitle/"], ["url_slug", "-urltitle-"]]
|
289
|
+
D, [2019-11-12T09:48:22.403039 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
290
|
+
D, [2019-11-12T09:48:22.403169 #25223] DEBUG -- : [1m[35m (0.0ms)[0m begin transaction
|
291
|
+
D, [2019-11-12T09:48:22.403420 #25223] DEBUG -- : [1m[36mPage Load (0.0ms)[0m [1mSELECT "pages".* FROM "pages" WHERE (url_slug = 'calcul-en-fran-aise' and parent_id IS NULL) ORDER BY "pages"."id" ASC LIMIT 1[0m
|
292
|
+
D, [2019-11-12T09:48:22.403599 #25223] DEBUG -- : [1m[35mSQL (0.0ms)[0m INSERT INTO "pages" ("title", "url_slug") VALUES (?, ?) [["title", "calculé en française"], ["url_slug", "calcul-en-fran-aise"]]
|
293
|
+
D, [2019-11-12T09:48:22.403710 #25223] DEBUG -- : [1m[36m (0.0ms)[0m [1mcommit transaction[0m
|
data/test/schema.rb
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'fixtures/page'
|
3
|
+
|
4
|
+
class ActsAsSlugableTest < ActiveSupport::TestCase
|
5
|
+
# Initialize the TestSuit and run all steps required to configure
|
6
|
+
# the environment properly.
|
7
|
+
setup do
|
8
|
+
@allowable_characters = Regexp.new('^[A-Za-z0-9_-]+$')
|
9
|
+
end
|
10
|
+
|
11
|
+
# after_validation callback hooks should exist.
|
12
|
+
test 'hooks_presence' do
|
13
|
+
assert Page._validation_callbacks.select{ |cb| cb.kind.eql?(:after)}.collect(&:filter).include?(:create_slug)
|
14
|
+
assert Page._validation_callbacks.select{ |cb| cb.kind.eql?(:after)}.collect(&:filter).include?(:create_slug)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Test whether the creation of the slug columns functions
|
18
|
+
test 'create' do
|
19
|
+
pg = Page.create(title: 'New Page')
|
20
|
+
assert pg.valid?
|
21
|
+
assert_equal 'new-page', pg.url_slug
|
22
|
+
|
23
|
+
|
24
|
+
pg = Page.create(title: 'Test override', parent_id: nil, url_slug: 'something-different')
|
25
|
+
assert pg.valid?
|
26
|
+
assert_equal 'something-different', pg.url_slug
|
27
|
+
end
|
28
|
+
|
29
|
+
# Test whether the model still runs validations
|
30
|
+
test 'model_still_runs_validations' do
|
31
|
+
pg = Page.create(title: nil)
|
32
|
+
assert !pg.valid?
|
33
|
+
assert pg.errors.get(:title)
|
34
|
+
|
35
|
+
pg = Page.create(title: '')
|
36
|
+
assert !pg.valid?
|
37
|
+
assert pg.errors.get(:title)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Test the update method
|
41
|
+
test 'update' do
|
42
|
+
pg = Page.create(title: 'Original Page')
|
43
|
+
assert pg.valid?
|
44
|
+
assert_equal 'original-page', pg.url_slug
|
45
|
+
|
46
|
+
# update, with title
|
47
|
+
pg.update_attribute(:title, 'Updated title only')
|
48
|
+
assert_equal 'original-page', pg.url_slug
|
49
|
+
|
50
|
+
# update, with title and nil slug
|
51
|
+
pg.update_attributes(title: 'Updated title and slug to nil', url_slug: nil)
|
52
|
+
assert_equal 'updated-title-and-slug-to-nil', pg.url_slug
|
53
|
+
|
54
|
+
# update, with empty slug
|
55
|
+
pg.update_attributes(title: 'Updated title and slug to empty', url_slug: '')
|
56
|
+
assert_equal 'updated-title-and-slug-to-empty', pg.url_slug
|
57
|
+
end
|
58
|
+
|
59
|
+
# Test the uniqueness
|
60
|
+
test 'uniqueness' do
|
61
|
+
t = 'Unique title'
|
62
|
+
|
63
|
+
pg1 = Page.create(title: t, parent_id: 1)
|
64
|
+
assert pg1.valid?
|
65
|
+
|
66
|
+
pg2 = Page.create(title: t, parent_id: 1)
|
67
|
+
assert pg2.valid?
|
68
|
+
|
69
|
+
assert_not_equal pg1.url_slug, pg2.url_slug
|
70
|
+
end
|
71
|
+
|
72
|
+
# Test the Scope
|
73
|
+
test 'scope' do
|
74
|
+
t = 'Unique scoped title'
|
75
|
+
|
76
|
+
pg1 = Page.create(title: t, parent_id: 1)
|
77
|
+
assert pg1.valid?
|
78
|
+
|
79
|
+
pg2 = Page.create(title: t, parent_id: 2)
|
80
|
+
assert pg2.valid?
|
81
|
+
|
82
|
+
assert_equal pg1.url_slug, pg2.url_slug
|
83
|
+
end
|
84
|
+
|
85
|
+
# Test Character replacement
|
86
|
+
test 'characters' do
|
87
|
+
check_for_allowable_characters 'Title'
|
88
|
+
check_for_allowable_characters 'Title and some spaces'
|
89
|
+
check_for_allowable_characters 'Title-with-dashes'
|
90
|
+
check_for_allowable_characters "Title-with'-$#)(*%symbols"
|
91
|
+
check_for_allowable_characters '/urltitle/'
|
92
|
+
check_for_allowable_characters 'calculé en française'
|
93
|
+
end
|
94
|
+
|
95
|
+
private
|
96
|
+
def check_for_allowable_characters(title)
|
97
|
+
pg = Page.create(title: title)
|
98
|
+
assert pg.valid?
|
99
|
+
assert_match @allowable_characters, pg.url_slug
|
100
|
+
end
|
101
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
3
|
+
ENV['RAILS_ENV'] = 'test'
|
4
|
+
|
5
|
+
require 'rails'
|
6
|
+
require 'rails/test_help'
|
7
|
+
require 'sqlite3'
|
8
|
+
require 'active_record'
|
9
|
+
require 'active_support'
|
10
|
+
require 'yaml'
|
11
|
+
require 'acts_as_slugable'
|
12
|
+
|
13
|
+
Rails.backtrace_cleaner.remove_silencers!
|
14
|
+
|
15
|
+
# Load support files
|
16
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
17
|
+
|
18
|
+
ActiveSupport::TestCase.test_order = :random
|
19
|
+
|
20
|
+
# Load fixtures from the engine
|
21
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
22
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__)
|
23
|
+
end
|
24
|
+
|
25
|
+
# run the database migrations
|
26
|
+
config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
|
27
|
+
|
28
|
+
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + '/debug.log')
|
29
|
+
ActiveRecord::Base.establish_connection(config[ENV['RAILS_ENV']])
|
30
|
+
load(File.dirname(__FILE__) + '/schema.rb')
|
31
|
+
|
metadata
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: acts_as_slugable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Arne De Herdt
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sqlite3
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: This gem is an attempt at converting an old Rails 2 plugin into a new
|
56
|
+
Gem.
|
57
|
+
email:
|
58
|
+
- arne.de.herdt@gmail.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- MIT-LICENSE
|
64
|
+
- README.rdoc
|
65
|
+
- Rakefile
|
66
|
+
- lib/acts_as_slugable.rb
|
67
|
+
- lib/acts_as_slugable/version.rb
|
68
|
+
- lib/tasks/slugable_tasks.rake
|
69
|
+
- test/database.yml
|
70
|
+
- test/debug.log
|
71
|
+
- test/fixtures/page.rb
|
72
|
+
- test/schema.rb
|
73
|
+
- test/slugable_test.rb
|
74
|
+
- test/test_helper.rb
|
75
|
+
homepage: ''
|
76
|
+
licenses:
|
77
|
+
- MIT
|
78
|
+
metadata: {}
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '2.1'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubygems_version: 3.0.3
|
95
|
+
signing_key:
|
96
|
+
specification_version: 4
|
97
|
+
summary: Gem that implements the old behavior of acts_as_slugable Rails Plugin.
|
98
|
+
test_files:
|
99
|
+
- test/test_helper.rb
|
100
|
+
- test/debug.log
|
101
|
+
- test/database.yml
|
102
|
+
- test/schema.rb
|
103
|
+
- test/fixtures/page.rb
|
104
|
+
- test/slugable_test.rb
|