tb_cms 1.3.3 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/controllers/pages_controller.rb +1 -1
- data/app/models/spud_page.rb +4 -0
- data/lib/spud_cms/version.rb +1 -1
- data/spec/dummy/config/database.yml +3 -6
- data/spec/dummy/config/environments/development.rb +2 -2
- data/spec/dummy/db/schema.rb +108 -105
- data/spec/models/spud_page_spec.rb +8 -0
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d674e42a14812fcc99fc125a85514ba33f016752e5cdcc7c4d7319e841505ea3
|
4
|
+
data.tar.gz: 5b1669484dff7f06e78db700051107954229d95ec11819a3d05144d5929fe050
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b819655bcdbb65fc611da5ddbba4a159dcb9a495d05fbcbd46b7c8d04351d014b8d974b0889b2fb0b53162a089658b99cbe69a190b88916699fbfa97e9240a59
|
7
|
+
data.tar.gz: 6583b6a1d64056748b9252381e51d6cfda5949c7b119ed0a731e7b5e382cb9522e0e6355d1a9392ba36ed50509d2c3b9c233ed389f037a16a1d77e42f392e88a
|
@@ -12,7 +12,7 @@ class PagesController < ApplicationController
|
|
12
12
|
end
|
13
13
|
|
14
14
|
url_name = !params[:id].blank? ? params[:id] : Spud::Cms.root_page_name
|
15
|
-
@page = SpudPage.published_pages.
|
15
|
+
@page = SpudPage.published_pages.find_ignoring_case(url_name)
|
16
16
|
|
17
17
|
if @page.blank?
|
18
18
|
render_404
|
data/app/models/spud_page.rb
CHANGED
data/lib/spud_cms/version.rb
CHANGED
@@ -4,12 +4,9 @@
|
|
4
4
|
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
5
|
# gem 'sqlite3'
|
6
6
|
development:
|
7
|
-
adapter:
|
7
|
+
adapter: postgresql
|
8
8
|
database: spud_cms_development
|
9
|
-
|
10
|
-
|
9
|
+
|
11
10
|
test:
|
12
|
-
adapter:
|
11
|
+
adapter: postgresql
|
13
12
|
database: spud_cms_test
|
14
|
-
username: root
|
15
|
-
|
@@ -23,11 +23,11 @@ Dummy::Application.configure do
|
|
23
23
|
config.action_dispatch.best_standards_support = :builtin
|
24
24
|
|
25
25
|
# Raise exception on mass assignment protection for Active Record models
|
26
|
-
config.active_record.mass_assignment_sanitizer = :strict
|
26
|
+
# config.active_record.mass_assignment_sanitizer = :strict
|
27
27
|
|
28
28
|
# Log the query plan for queries taking more than this (works
|
29
29
|
# with SQLite, MySQL, and PostgreSQL)
|
30
|
-
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
30
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
31
|
|
32
32
|
# Do not compress assets
|
33
33
|
config.assets.compress = false
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -12,163 +12,166 @@
|
|
12
12
|
|
13
13
|
ActiveRecord::Schema.define(version: 20160215180157) do
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
t.
|
20
|
-
t.integer
|
21
|
-
t.
|
15
|
+
# These are extensions that must be enabled in order to support this database
|
16
|
+
enable_extension "plpgsql"
|
17
|
+
|
18
|
+
create_table "spud_menu_items", id: :serial, force: :cascade do |t|
|
19
|
+
t.string "parent_type"
|
20
|
+
t.integer "parent_id"
|
21
|
+
t.integer "item_type"
|
22
|
+
t.integer "spud_page_id"
|
23
|
+
t.integer "menu_order", default: 0
|
24
|
+
t.string "url"
|
22
25
|
t.datetime "created_at"
|
23
26
|
t.datetime "updated_at"
|
24
|
-
t.string
|
25
|
-
t.integer
|
26
|
-
t.string
|
27
|
-
t.index ["menu_order"], name: "index_spud_menu_items_on_menu_order"
|
28
|
-
t.index ["parent_type", "parent_id"], name: "index_spud_menu_items_on_parent_type_and_parent_id"
|
29
|
-
t.index ["spud_menu_id"], name: "index_spud_menu_items_on_spud_menu_id"
|
27
|
+
t.string "name"
|
28
|
+
t.integer "spud_menu_id"
|
29
|
+
t.string "classes"
|
30
|
+
t.index ["menu_order"], name: "index_spud_menu_items_on_menu_order"
|
31
|
+
t.index ["parent_type", "parent_id"], name: "index_spud_menu_items_on_parent_type_and_parent_id"
|
32
|
+
t.index ["spud_menu_id"], name: "index_spud_menu_items_on_spud_menu_id"
|
30
33
|
end
|
31
34
|
|
32
|
-
create_table "spud_menus",
|
33
|
-
t.string
|
34
|
-
t.text
|
35
|
+
create_table "spud_menus", id: :serial, force: :cascade do |t|
|
36
|
+
t.string "name"
|
37
|
+
t.text "description"
|
35
38
|
t.datetime "created_at"
|
36
39
|
t.datetime "updated_at"
|
37
40
|
end
|
38
41
|
|
39
|
-
create_table "spud_page_partial_revisions",
|
40
|
-
t.string
|
41
|
-
t.text
|
42
|
-
t.string
|
43
|
-
t.integer
|
42
|
+
create_table "spud_page_partial_revisions", id: :serial, force: :cascade do |t|
|
43
|
+
t.string "name"
|
44
|
+
t.text "content"
|
45
|
+
t.string "format"
|
46
|
+
t.integer "spud_page_id"
|
44
47
|
t.datetime "created_at"
|
45
48
|
t.datetime "updated_at"
|
46
|
-
t.index ["spud_page_id", "name"], name: "revision_idx"
|
49
|
+
t.index ["spud_page_id", "name"], name: "revision_idx"
|
47
50
|
end
|
48
51
|
|
49
|
-
create_table "spud_page_partials",
|
50
|
-
t.integer
|
51
|
-
t.string
|
52
|
-
t.text
|
53
|
-
t.string
|
52
|
+
create_table "spud_page_partials", id: :serial, force: :cascade do |t|
|
53
|
+
t.integer "spud_page_id"
|
54
|
+
t.string "name"
|
55
|
+
t.text "content"
|
56
|
+
t.string "format"
|
54
57
|
t.datetime "created_at"
|
55
58
|
t.datetime "updated_at"
|
56
|
-
t.string
|
57
|
-
t.text
|
58
|
-
t.index ["spud_page_id"], name: "index_spud_page_partials_on_spud_page_id"
|
59
|
+
t.string "symbol_name"
|
60
|
+
t.text "content_processed"
|
61
|
+
t.index ["spud_page_id"], name: "index_spud_page_partials_on_spud_page_id"
|
59
62
|
end
|
60
63
|
|
61
|
-
create_table "spud_pages",
|
62
|
-
t.string
|
63
|
-
t.string
|
64
|
+
create_table "spud_pages", id: :serial, force: :cascade do |t|
|
65
|
+
t.string "name"
|
66
|
+
t.string "url_name"
|
64
67
|
t.datetime "publish_at"
|
65
|
-
t.integer
|
66
|
-
t.integer
|
67
|
-
t.string
|
68
|
-
t.integer
|
69
|
-
t.text
|
70
|
-
t.string
|
71
|
-
t.integer
|
68
|
+
t.integer "created_by"
|
69
|
+
t.integer "updated_by"
|
70
|
+
t.string "format", default: "html"
|
71
|
+
t.integer "spud_page_id"
|
72
|
+
t.text "meta_description"
|
73
|
+
t.string "meta_keywords"
|
74
|
+
t.integer "page_order"
|
72
75
|
t.datetime "created_at"
|
73
76
|
t.datetime "updated_at"
|
74
|
-
t.integer
|
75
|
-
t.boolean
|
76
|
-
t.boolean
|
77
|
-
t.text
|
78
|
-
t.string
|
79
|
-
t.string
|
77
|
+
t.integer "visibility", default: 0
|
78
|
+
t.boolean "published", default: true
|
79
|
+
t.boolean "use_custom_url_name", default: false
|
80
|
+
t.text "notes"
|
81
|
+
t.string "layout"
|
82
|
+
t.string "page_title"
|
80
83
|
end
|
81
84
|
|
82
|
-
create_table "spud_permalinks",
|
83
|
-
t.string
|
84
|
-
t.string
|
85
|
-
t.integer
|
85
|
+
create_table "spud_permalinks", id: :serial, force: :cascade do |t|
|
86
|
+
t.string "url_name"
|
87
|
+
t.string "attachment_type"
|
88
|
+
t.integer "attachment_id"
|
86
89
|
t.datetime "created_at"
|
87
90
|
t.datetime "updated_at"
|
88
|
-
t.integer
|
89
|
-
t.index ["attachment_type", "attachment_id"], name: "idx_permalink_attachment"
|
90
|
-
t.index ["site_id"], name: "idx_permalinks_site_id"
|
91
|
+
t.integer "site_id", default: 0, null: false
|
92
|
+
t.index ["attachment_type", "attachment_id"], name: "idx_permalink_attachment"
|
93
|
+
t.index ["site_id"], name: "idx_permalinks_site_id"
|
91
94
|
end
|
92
95
|
|
93
|
-
create_table "spud_permissions",
|
94
|
-
t.string
|
95
|
-
t.string
|
96
|
+
create_table "spud_permissions", id: :serial, force: :cascade do |t|
|
97
|
+
t.string "name", null: false
|
98
|
+
t.string "tag", null: false
|
96
99
|
t.datetime "created_at"
|
97
100
|
t.datetime "updated_at"
|
98
|
-
t.index ["tag"], name: "index_spud_permissions_on_tag", unique: true
|
101
|
+
t.index ["tag"], name: "index_spud_permissions_on_tag", unique: true
|
99
102
|
end
|
100
103
|
|
101
|
-
create_table "spud_role_permissions",
|
102
|
-
t.integer
|
103
|
-
t.string
|
104
|
+
create_table "spud_role_permissions", id: :serial, force: :cascade do |t|
|
105
|
+
t.integer "spud_role_id", null: false
|
106
|
+
t.string "spud_permission_tag", null: false
|
104
107
|
t.datetime "created_at"
|
105
108
|
t.datetime "updated_at"
|
106
|
-
t.index ["spud_permission_tag"], name: "index_spud_role_permissions_on_spud_permission_tag"
|
107
|
-
t.index ["spud_role_id"], name: "index_spud_role_permissions_on_spud_role_id"
|
109
|
+
t.index ["spud_permission_tag"], name: "index_spud_role_permissions_on_spud_permission_tag"
|
110
|
+
t.index ["spud_role_id"], name: "index_spud_role_permissions_on_spud_role_id"
|
108
111
|
end
|
109
112
|
|
110
|
-
create_table "spud_roles",
|
111
|
-
t.string
|
113
|
+
create_table "spud_roles", id: :serial, force: :cascade do |t|
|
114
|
+
t.string "name"
|
112
115
|
t.datetime "created_at"
|
113
116
|
t.datetime "updated_at"
|
114
117
|
end
|
115
118
|
|
116
|
-
create_table "spud_snippets",
|
117
|
-
t.string
|
118
|
-
t.text
|
119
|
-
t.string
|
120
|
-
t.text
|
119
|
+
create_table "spud_snippets", id: :serial, force: :cascade do |t|
|
120
|
+
t.string "name"
|
121
|
+
t.text "content"
|
122
|
+
t.string "format"
|
123
|
+
t.text "content_processed"
|
121
124
|
t.datetime "created_at"
|
122
125
|
t.datetime "updated_at"
|
123
|
-
t.index ["name"], name: "index_spud_snippets_on_name"
|
126
|
+
t.index ["name"], name: "index_spud_snippets_on_name"
|
124
127
|
end
|
125
128
|
|
126
|
-
create_table "spud_user_settings",
|
127
|
-
t.integer
|
128
|
-
t.string
|
129
|
-
t.string
|
129
|
+
create_table "spud_user_settings", id: :serial, force: :cascade do |t|
|
130
|
+
t.integer "spud_user_id"
|
131
|
+
t.string "key"
|
132
|
+
t.string "value"
|
130
133
|
t.datetime "created_at"
|
131
134
|
t.datetime "updated_at"
|
132
135
|
end
|
133
136
|
|
134
|
-
create_table "spud_users",
|
135
|
-
t.string
|
136
|
-
t.string
|
137
|
-
t.boolean
|
138
|
-
t.string
|
139
|
-
t.string
|
140
|
-
t.string
|
141
|
-
t.string
|
142
|
-
t.string
|
143
|
-
t.string
|
144
|
-
t.string
|
145
|
-
t.integer
|
146
|
-
t.integer
|
137
|
+
create_table "spud_users", id: :serial, force: :cascade do |t|
|
138
|
+
t.string "first_name"
|
139
|
+
t.string "last_name"
|
140
|
+
t.boolean "super_admin"
|
141
|
+
t.string "login", null: false
|
142
|
+
t.string "email", null: false
|
143
|
+
t.string "crypted_password", null: false
|
144
|
+
t.string "password_salt", null: false
|
145
|
+
t.string "persistence_token", null: false
|
146
|
+
t.string "single_access_token", null: false
|
147
|
+
t.string "perishable_token", null: false
|
148
|
+
t.integer "login_count", default: 0, null: false
|
149
|
+
t.integer "failed_login_count", default: 0, null: false
|
147
150
|
t.datetime "last_request_at"
|
148
151
|
t.datetime "current_login_at"
|
149
152
|
t.datetime "last_login_at"
|
150
|
-
t.string
|
151
|
-
t.string
|
153
|
+
t.string "current_login_ip"
|
154
|
+
t.string "last_login_ip"
|
152
155
|
t.datetime "created_at"
|
153
156
|
t.datetime "updated_at"
|
154
|
-
t.string
|
155
|
-
t.integer
|
156
|
-
t.boolean
|
157
|
-
t.index ["email"], name: "index_spud_users_on_email"
|
158
|
-
t.index ["login"], name: "index_spud_users_on_login"
|
159
|
-
t.index ["spud_role_id"], name: "index_spud_users_on_spud_role_id"
|
157
|
+
t.string "time_zone"
|
158
|
+
t.integer "spud_role_id"
|
159
|
+
t.boolean "requires_password_change", default: false
|
160
|
+
t.index ["email"], name: "index_spud_users_on_email"
|
161
|
+
t.index ["login"], name: "index_spud_users_on_login"
|
162
|
+
t.index ["spud_role_id"], name: "index_spud_users_on_spud_role_id"
|
160
163
|
end
|
161
164
|
|
162
|
-
create_table "tb_redirects",
|
163
|
-
t.string
|
164
|
-
t.integer
|
165
|
-
t.string
|
166
|
-
t.string
|
167
|
-
t.string
|
168
|
-
t.datetime "created_at",
|
169
|
-
t.datetime "updated_at",
|
170
|
-
t.index ["owner_type", "owner_id"], name: "index_tb_redirects_on_owner_type_and_owner_id"
|
171
|
-
t.index ["source"], name: "index_tb_redirects_on_source", unique: true
|
165
|
+
create_table "tb_redirects", id: :serial, force: :cascade do |t|
|
166
|
+
t.string "owner_type"
|
167
|
+
t.integer "owner_id"
|
168
|
+
t.string "source", null: false
|
169
|
+
t.string "destination", null: false
|
170
|
+
t.string "created_by"
|
171
|
+
t.datetime "created_at", null: false
|
172
|
+
t.datetime "updated_at", null: false
|
173
|
+
t.index ["owner_type", "owner_id"], name: "index_tb_redirects_on_owner_type_and_owner_id"
|
174
|
+
t.index ["source"], name: "index_tb_redirects_on_source", unique: true
|
172
175
|
end
|
173
176
|
|
174
177
|
end
|
@@ -92,4 +92,12 @@ describe SpudPage, type: :model do
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
+
describe '.find_ignoring_case' do
|
96
|
+
it 'finds the page ignoring case' do
|
97
|
+
page = FactoryBot.create(:spud_page, url_name: 'HEy-guyS-lETS-Mix-CAsE')
|
98
|
+
found = SpudPage.find_ignoring_case('hey-guys-lets-mix-case')
|
99
|
+
expect(page).to eq(found)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
95
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tb_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moser Consulting
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -53,19 +53,19 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.0.beta1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: pg
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.18'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '0.18'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -337,8 +337,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
337
337
|
- !ruby/object:Gem::Version
|
338
338
|
version: '0'
|
339
339
|
requirements: []
|
340
|
-
|
341
|
-
rubygems_version: 2.6.12
|
340
|
+
rubygems_version: 3.0.8
|
342
341
|
signing_key:
|
343
342
|
specification_version: 4
|
344
343
|
summary: Twice Baked CMS
|