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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cf2fe4b361b6f73b675c9c263b53be34c0a80c60
4
- data.tar.gz: 2b8ced4d2cfdd18bd7578f2dadc284dcf89cb9e7
2
+ SHA256:
3
+ metadata.gz: d674e42a14812fcc99fc125a85514ba33f016752e5cdcc7c4d7319e841505ea3
4
+ data.tar.gz: 5b1669484dff7f06e78db700051107954229d95ec11819a3d05144d5929fe050
5
5
  SHA512:
6
- metadata.gz: fb80687cde5988b4b9151c31e711c4487807d6d794a398da68bb6f606957194cbd8f5e58c8c51d3a0654ade1b0efa43386c0b8ffe9fb8a937018b603e64e9817
7
- data.tar.gz: 0a11371e6df82a12cd4d0652d4a6ab6db7580cd58d8e95b9568573327dc5b8c5fb88637bdc2331a9cd9b9ffda839028476f69cad20adb7e55b22b0d1b8b81d47
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.find_by(url_name: url_name)
15
+ @page = SpudPage.published_pages.find_ignoring_case(url_name)
16
16
 
17
17
  if @page.blank?
18
18
  render_404
@@ -59,6 +59,10 @@ class SpudPage < ActiveRecord::Base
59
59
  return visibility == 1
60
60
  end
61
61
 
62
+ def self.find_ignoring_case(url_name)
63
+ find_by(arel_table[:url_name].matches(url_name))
64
+ end
65
+
62
66
  private
63
67
 
64
68
  def generate_url_name
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Cms
3
- VERSION = '1.3.3'.freeze
3
+ VERSION = '1.3.5'.freeze
4
4
  end
5
5
  end
@@ -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: mysql2
7
+ adapter: postgresql
8
8
  database: spud_cms_development
9
- username: root
10
-
9
+
11
10
  test:
12
- adapter: mysql2
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
@@ -12,163 +12,166 @@
12
12
 
13
13
  ActiveRecord::Schema.define(version: 20160215180157) do
14
14
 
15
- create_table "spud_menu_items", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
16
- t.string "parent_type"
17
- t.integer "parent_id"
18
- t.integer "item_type"
19
- t.integer "spud_page_id"
20
- t.integer "menu_order", default: 0
21
- t.string "url"
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 "name"
25
- t.integer "spud_menu_id"
26
- t.string "classes"
27
- t.index ["menu_order"], name: "index_spud_menu_items_on_menu_order", using: :btree
28
- t.index ["parent_type", "parent_id"], name: "index_spud_menu_items_on_parent_type_and_parent_id", using: :btree
29
- t.index ["spud_menu_id"], name: "index_spud_menu_items_on_spud_menu_id", using: :btree
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", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
33
- t.string "name"
34
- t.text "description", limit: 65535
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", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
40
- t.string "name"
41
- t.text "content", limit: 65535
42
- t.string "format"
43
- t.integer "spud_page_id"
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", using: :btree
49
+ t.index ["spud_page_id", "name"], name: "revision_idx"
47
50
  end
48
51
 
49
- create_table "spud_page_partials", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
50
- t.integer "spud_page_id"
51
- t.string "name"
52
- t.text "content", limit: 65535
53
- t.string "format"
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 "symbol_name"
57
- t.text "content_processed", limit: 65535
58
- t.index ["spud_page_id"], name: "index_spud_page_partials_on_spud_page_id", using: :btree
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", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
62
- t.string "name"
63
- t.string "url_name"
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 "created_by"
66
- t.integer "updated_by"
67
- t.string "format", default: "html"
68
- t.integer "spud_page_id"
69
- t.text "meta_description", limit: 65535
70
- t.string "meta_keywords"
71
- t.integer "page_order"
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 "visibility", default: 0
75
- t.boolean "published", default: true
76
- t.boolean "use_custom_url_name", default: false
77
- t.text "notes", limit: 65535
78
- t.string "layout"
79
- t.string "page_title"
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", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
83
- t.string "url_name"
84
- t.string "attachment_type"
85
- t.integer "attachment_id"
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 "site_id", default: 0, null: false
89
- t.index ["attachment_type", "attachment_id"], name: "idx_permalink_attachment", using: :btree
90
- t.index ["site_id"], name: "idx_permalinks_site_id", using: :btree
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", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
94
- t.string "name", null: false
95
- t.string "tag", null: false
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, using: :btree
101
+ t.index ["tag"], name: "index_spud_permissions_on_tag", unique: true
99
102
  end
100
103
 
101
- create_table "spud_role_permissions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
102
- t.integer "spud_role_id", null: false
103
- t.string "spud_permission_tag", null: false
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", using: :btree
107
- t.index ["spud_role_id"], name: "index_spud_role_permissions_on_spud_role_id", using: :btree
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", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
111
- t.string "name"
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", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
117
- t.string "name"
118
- t.text "content", limit: 65535
119
- t.string "format"
120
- t.text "content_processed", limit: 65535
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", using: :btree
126
+ t.index ["name"], name: "index_spud_snippets_on_name"
124
127
  end
125
128
 
126
- create_table "spud_user_settings", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
127
- t.integer "spud_user_id"
128
- t.string "key"
129
- t.string "value"
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", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
135
- t.string "first_name"
136
- t.string "last_name"
137
- t.boolean "super_admin"
138
- t.string "login", null: false
139
- t.string "email", null: false
140
- t.string "crypted_password", null: false
141
- t.string "password_salt", null: false
142
- t.string "persistence_token", null: false
143
- t.string "single_access_token", null: false
144
- t.string "perishable_token", null: false
145
- t.integer "login_count", default: 0, null: false
146
- t.integer "failed_login_count", default: 0, null: false
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 "current_login_ip"
151
- t.string "last_login_ip"
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 "time_zone"
155
- t.integer "spud_role_id"
156
- t.boolean "requires_password_change", default: false
157
- t.index ["email"], name: "index_spud_users_on_email", using: :btree
158
- t.index ["login"], name: "index_spud_users_on_login", using: :btree
159
- t.index ["spud_role_id"], name: "index_spud_users_on_spud_role_id", using: :btree
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", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
163
- t.string "owner_type"
164
- t.integer "owner_id"
165
- t.string "source", null: false
166
- t.string "destination", null: false
167
- t.string "created_by"
168
- t.datetime "created_at", null: false
169
- t.datetime "updated_at", null: false
170
- t.index ["owner_type", "owner_id"], name: "index_tb_redirects_on_owner_type_and_owner_id", using: :btree
171
- t.index ["source"], name: "index_tb_redirects_on_source", unique: true, using: :btree
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.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: 2018-02-26 00:00:00.000000000 Z
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: mysql2
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
- rubyforge_project:
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