tb_cms 1.3.0 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -9
  3. data/app/assets/javascripts/admin/cms/application.js +1 -1
  4. data/app/assets/javascripts/admin/cms/menu_items.js +14 -8
  5. data/app/assets/javascripts/admin/cms/pages.js +9 -7
  6. data/app/controllers/admin/pages_controller.rb +1 -1
  7. data/app/controllers/cms/sitemaps_controller.rb +1 -1
  8. data/app/controllers/pages_controller.rb +4 -4
  9. data/app/helpers/cms/application_helper.rb +4 -4
  10. data/app/models/spud_menu_item.rb +3 -3
  11. data/app/models/spud_page.rb +22 -10
  12. data/app/models/spud_page_partial.rb +3 -20
  13. data/app/models/spud_snippet.rb +1 -4
  14. data/app/views/admin/menu_items/index.html.erb +2 -2
  15. data/app/views/admin/pages/_form.html.erb +2 -2
  16. data/app/views/admin/pages/_page_partials_form.html.erb +1 -1
  17. data/app/views/admin/pages/_page_row.html.erb +1 -1
  18. data/app/views/admin/pages/show.html.erb +12 -15
  19. data/app/views/pages/show.html.erb +2 -2
  20. data/db/migrate/20120101192412_create_spud_pages.rb +1 -1
  21. data/db/migrate/20120101193138_create_spud_menus.rb +1 -1
  22. data/db/migrate/20120101193255_create_spud_menu_items.rb +1 -1
  23. data/db/migrate/20120101194124_create_spud_templates.rb +1 -1
  24. data/db/migrate/20120103034659_create_spud_page_partials.rb +1 -1
  25. data/db/migrate/20120104194032_add_visibility_to_spud_pages.rb +1 -1
  26. data/db/migrate/20120107181337_add_menu_name_to_spud_menu_items.rb +1 -1
  27. data/db/migrate/20120111134754_add_use_custom_url_name_to_spud_pages.rb +1 -1
  28. data/db/migrate/20120118141852_add_notes_to_spud_pages.rb +1 -1
  29. data/db/migrate/20120126232428_add_menu_id_to_spud_menu_items.rb +1 -1
  30. data/db/migrate/20120128163601_add_classes_to_spud_menu_items.rb +1 -1
  31. data/db/migrate/20120329132314_add_site_id_to_spud_pages.rb +1 -1
  32. data/db/migrate/20120329132322_add_site_id_to_spud_templates.rb +1 -1
  33. data/db/migrate/20120329132330_add_site_id_to_spud_menus.rb +1 -1
  34. data/db/migrate/20120510195151_create_spud_page_partial_revisions.rb +1 -1
  35. data/db/migrate/20120911190030_add_symbol_name_to_spud_page_partials.rb +1 -1
  36. data/db/migrate/20120912121313_modify_site_id_for_spud_pages.rb +1 -1
  37. data/db/migrate/20121016233715_add_content_processed_to_spud_page_partials.rb +1 -1
  38. data/db/migrate/20121112151110_add_layout_to_spud_pages.rb +1 -1
  39. data/db/migrate/20121119025608_create_spud_snippets.rb +1 -1
  40. data/db/migrate/20150108162839_remove_site_id_from_cms_tables.rb +1 -1
  41. data/db/migrate/20150622161403_add_title_tag_to_spud_page.rb +1 -1
  42. data/lib/spud_cms/engine.rb +4 -15
  43. data/lib/spud_cms/template_parser.rb +2 -2
  44. data/lib/spud_cms/version.rb +1 -1
  45. data/lib/tb_cms.rb +0 -1
  46. data/spec/controllers/admin/menu_items_controller_spec.rb +18 -18
  47. data/spec/controllers/admin/menus_controller_spec.rb +9 -9
  48. data/spec/controllers/admin/pages_controller_spec.rb +9 -9
  49. data/spec/controllers/pages_controller_spec.rb +5 -5
  50. data/spec/dummy/app/controllers/application_controller.rb +1 -1
  51. data/spec/dummy/config/application.rb +1 -1
  52. data/spec/dummy/config/database.yml +3 -6
  53. data/spec/dummy/config/environments/development.rb +2 -2
  54. data/spec/dummy/db/migrate/20141231214446_create_spud_admin_permissions.tb_core.rb +1 -1
  55. data/spec/dummy/db/migrate/20141231214447_create_spud_users.tb_core.rb +1 -1
  56. data/spec/dummy/db/migrate/20141231214448_add_time_zone_to_spud_user.tb_core.rb +1 -1
  57. data/spec/dummy/db/migrate/20141231214449_add_scope_to_spud_admin_permissions.tb_core.rb +1 -1
  58. data/spec/dummy/db/migrate/20141231214450_create_spud_user_settings.tb_core.rb +1 -1
  59. data/spec/dummy/db/migrate/20141231214451_create_spud_roles.tb_core.rb +1 -1
  60. data/spec/dummy/db/migrate/20141231214452_create_spud_permissions.tb_core.rb +1 -1
  61. data/spec/dummy/db/migrate/20141231214453_create_spud_role_permissions.tb_core.rb +1 -1
  62. data/spec/dummy/db/migrate/20141231214454_drop_spud_admin_permissions.tb_core.rb +1 -1
  63. data/spec/dummy/db/migrate/20141231214455_create_spud_permalinks.tb_permalinks.rb +1 -1
  64. data/spec/dummy/db/migrate/20141231214456_add_site_id_to_spud_permalinks.tb_permalinks.rb +1 -1
  65. data/spec/dummy/db/migrate/20141231214457_modify_site_id_for_spud_permalinks.tb_permalinks.rb +1 -1
  66. data/spec/dummy/db/migrate/20141231214459_create_spud_pages.tb_cms.rb +1 -1
  67. data/spec/dummy/db/migrate/20141231214460_create_spud_menus.tb_cms.rb +1 -1
  68. data/spec/dummy/db/migrate/20141231214461_create_spud_menu_items.tb_cms.rb +1 -1
  69. data/spec/dummy/db/migrate/20141231214462_create_spud_templates.tb_cms.rb +1 -1
  70. data/spec/dummy/db/migrate/20141231214463_create_spud_page_partials.tb_cms.rb +1 -1
  71. data/spec/dummy/db/migrate/20141231214464_add_visibility_to_spud_pages.tb_cms.rb +1 -1
  72. data/spec/dummy/db/migrate/20141231214465_add_menu_name_to_spud_menu_items.tb_cms.rb +1 -1
  73. data/spec/dummy/db/migrate/20141231214466_add_use_custom_url_name_to_spud_pages.tb_cms.rb +1 -1
  74. data/spec/dummy/db/migrate/20141231214467_add_notes_to_spud_pages.tb_cms.rb +1 -1
  75. data/spec/dummy/db/migrate/20141231214468_add_menu_id_to_spud_menu_items.tb_cms.rb +1 -1
  76. data/spec/dummy/db/migrate/20141231214469_add_classes_to_spud_menu_items.tb_cms.rb +1 -1
  77. data/spec/dummy/db/migrate/20141231214470_add_site_id_to_spud_pages.tb_cms.rb +1 -1
  78. data/spec/dummy/db/migrate/20141231214471_add_site_id_to_spud_templates.tb_cms.rb +1 -1
  79. data/spec/dummy/db/migrate/20141231214472_add_site_id_to_spud_menus.tb_cms.rb +1 -1
  80. data/spec/dummy/db/migrate/20141231214473_create_spud_page_partial_revisions.tb_cms.rb +1 -1
  81. data/spec/dummy/db/migrate/20141231214474_add_symbol_name_to_spud_page_partials.tb_cms.rb +1 -1
  82. data/spec/dummy/db/migrate/20141231214475_modify_site_id_for_spud_pages.tb_cms.rb +1 -1
  83. data/spec/dummy/db/migrate/20141231214476_add_content_processed_to_spud_page_partials.tb_cms.rb +1 -1
  84. data/spec/dummy/db/migrate/20141231214477_add_layout_to_spud_pages.tb_cms.rb +1 -1
  85. data/spec/dummy/db/migrate/20141231214479_create_spud_snippets.tb_cms.rb +1 -1
  86. data/spec/dummy/db/migrate/20150108164814_remove_site_id_from_cms_tables.tb_cms.rb +1 -1
  87. data/spec/dummy/db/migrate/20150911185843_add_requires_password_change_to_spud_users.tb_core.rb +1 -1
  88. data/spec/dummy/db/migrate/20150911185844_add_title_tag_to_spud_page.tb_cms.rb +1 -1
  89. data/spec/dummy/db/migrate/20160215180157_create_tb_redirects.tb_redirects.rb +1 -1
  90. data/spec/dummy/db/schema.rb +108 -115
  91. data/spec/helpers/cms/application_helper_spec.rb +37 -37
  92. data/spec/models/spud_menu_item_spec.rb +4 -4
  93. data/spec/models/spud_page_partial_spec.rb +5 -5
  94. data/spec/models/spud_page_spec.rb +20 -12
  95. data/spec/rails_helper.rb +1 -1
  96. metadata +70 -96
  97. data/db/migrate/20121112212113_create_spud_page_liquid_tags.rb +0 -11
  98. data/db/migrate/20121119030136_change_liquid_tags_to_polymorphic.rb +0 -17
  99. data/db/migrate/20140110142037_drop_spud_page_liquid_tags.rb +0 -31
  100. data/lib/spud_cms/liquid_snippet.rb +0 -27
  101. data/spec/dummy/db/migrate/20141231214458_create_tb_liquid_spud_liquid_tags.tb_liquid.rb +0 -13
  102. data/spec/dummy/db/migrate/20141231214478_create_spud_page_liquid_tags.tb_cms.rb +0 -12
  103. data/spec/dummy/db/migrate/20141231214480_change_liquid_tags_to_polymorphic.tb_cms.rb +0 -18
  104. data/spec/dummy/db/migrate/20141231214481_drop_spud_page_liquid_tags.tb_cms.rb +0 -30
@@ -4,21 +4,21 @@ describe PagesController, type: :controller do
4
4
  describe 'show' do
5
5
 
6
6
  it 'should render a page' do
7
- page = FactoryGirl.create(:spud_page)
7
+ page = FactoryBot.create(:spud_page)
8
8
  get :show, params: { id: page.url_name }
9
9
  expect(assigns(:layout)).to render_template(layout: "layouts/#{Spud::Cms.default_page_layout}")
10
10
  expect(response).to be_success
11
11
  end
12
12
 
13
13
  it 'should render home page if id is blank' do
14
- page = FactoryGirl.create(:spud_page, name: 'home')
14
+ page = FactoryBot.create(:spud_page, name: 'home')
15
15
  get :show
16
16
  expect(assigns(:page)).to eq(page)
17
17
  expect(response).to be_success
18
18
  end
19
19
 
20
20
  it 'should redirect to new page url from old page url if it was changed' do
21
- page = FactoryGirl.create(:spud_page, name: 'about', url_name: 'about')
21
+ page = FactoryBot.create(:spud_page, name: 'about', url_name: 'about')
22
22
  page.update(url_name: 'about-us')
23
23
  page.save
24
24
  get :show, params: { id: 'about' }
@@ -27,7 +27,7 @@ describe PagesController, type: :controller do
27
27
  end
28
28
 
29
29
  it 'should not allow access to private pages when logged out' do
30
- page = FactoryGirl.create(:spud_page, name: 'about', visibility: 1)
30
+ page = FactoryBot.create(:spud_page, name: 'about', visibility: 1)
31
31
 
32
32
  get :show, params: { id: 'about' }
33
33
  expect(response).to redirect_to login_path(return_to: '/about')
@@ -43,7 +43,7 @@ describe PagesController, type: :controller do
43
43
  end
44
44
 
45
45
  it 'should allow access to private pages when logged in' do
46
- page = FactoryGirl.create(:spud_page, name: 'about', visibility: 1)
46
+ page = FactoryBot.create(:spud_page, name: 'about', visibility: 1)
47
47
 
48
48
  get :show, params: { id: 'about' }
49
49
  expect(response).to be_success
@@ -1,3 +1,3 @@
1
- class ApplicationController < Spud::ApplicationController
1
+ class ApplicationController < TbCore::ApplicationController
2
2
  protect_from_forgery
3
3
  end
@@ -8,7 +8,7 @@ require 'tb_cms'
8
8
  module Dummy
9
9
  class Application < Rails::Application
10
10
 
11
- Spud::Core.configure do |config|
11
+ TbCore.configure do |config|
12
12
  config.site_name = 'Test Site'
13
13
  end
14
14
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_core (originally 20111214161011)
2
- class CreateSpudAdminPermissions < ActiveRecord::Migration
2
+ class CreateSpudAdminPermissions < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_admin_permissions do |t|
5
5
  t.integer :user_id
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_core (originally 20111214161146)
2
- class CreateSpudUsers < ActiveRecord::Migration
2
+ class CreateSpudUsers < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_users do |t|
5
5
 
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_core (originally 20120327124229)
2
- class AddTimeZoneToSpudUser < ActiveRecord::Migration
2
+ class AddTimeZoneToSpudUser < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_users, :time_zone, :string
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_core (originally 20120328235431)
2
- class AddScopeToSpudAdminPermissions < ActiveRecord::Migration
2
+ class AddScopeToSpudAdminPermissions < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_admin_permissions, :scope, :string
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_core (originally 20120329174000)
2
- class CreateSpudUserSettings < ActiveRecord::Migration
2
+ class CreateSpudUserSettings < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_user_settings do |t|
5
5
  t.integer :spud_user_id
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_core (originally 20130620143010)
2
- class CreateSpudRoles < ActiveRecord::Migration
2
+ class CreateSpudRoles < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_roles do |t|
5
5
  t.string :name
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_core (originally 20130620143941)
2
- class CreateSpudPermissions < ActiveRecord::Migration
2
+ class CreateSpudPermissions < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_permissions do |t|
5
5
  t.string :name, null: false
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_core (originally 20130620151132)
2
- class CreateSpudRolePermissions < ActiveRecord::Migration
2
+ class CreateSpudRolePermissions < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_role_permissions do |t|
5
5
  t.integer :spud_role_id, null: false
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_core (originally 20130620163144)
2
- class DropSpudAdminPermissions < ActiveRecord::Migration
2
+ class DropSpudAdminPermissions < ActiveRecord::Migration[4.2]
3
3
  def up
4
4
  drop_table :spud_admin_permissions
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_permalinks (originally 20120306195503)
2
- class CreateSpudPermalinks < ActiveRecord::Migration
2
+ class CreateSpudPermalinks < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_permalinks do |t|
5
5
  t.string :url_name
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_permalinks (originally 20120329135522)
2
- class AddSiteIdToSpudPermalinks < ActiveRecord::Migration
2
+ class AddSiteIdToSpudPermalinks < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_permalinks, :site_id, :integer
5
5
  add_index :spud_permalinks, :site_id, name: 'idx_permalinks_site_id'
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_permalinks (originally 20120912123700)
2
- class ModifySiteIdForSpudPermalinks < ActiveRecord::Migration
2
+ class ModifySiteIdForSpudPermalinks < ActiveRecord::Migration[4.2]
3
3
  def up
4
4
  change_column :spud_permalinks, :site_id, :integer, default: 0, null: false
5
5
  # SpudPermalink.where(:site_id => nil).each {|f| f.site_id = 0 ; f.save}
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120101192412)
2
- class CreateSpudPages < ActiveRecord::Migration
2
+ class CreateSpudPages < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_pages do |t|
5
5
  t.string :name
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120101193138)
2
- class CreateSpudMenus < ActiveRecord::Migration
2
+ class CreateSpudMenus < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_menus do |t|
5
5
  t.string :name
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120101193255)
2
- class CreateSpudMenuItems < ActiveRecord::Migration
2
+ class CreateSpudMenuItems < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_menu_items do |t|
5
5
  t.string :parent_type
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120101194124)
2
- class CreateSpudTemplates < ActiveRecord::Migration
2
+ class CreateSpudTemplates < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_templates do |t|
5
5
  t.string :name
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120103034659)
2
- class CreateSpudPagePartials < ActiveRecord::Migration
2
+ class CreateSpudPagePartials < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_page_partials do |t|
5
5
  t.integer :spud_page_id
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120104194032)
2
- class AddVisibilityToSpudPages < ActiveRecord::Migration
2
+ class AddVisibilityToSpudPages < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_pages, :visibility, :integer, default: 0
5
5
  add_column :spud_pages, :published, :boolean, default: true
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120107181337)
2
- class AddMenuNameToSpudMenuItems < ActiveRecord::Migration
2
+ class AddMenuNameToSpudMenuItems < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_menu_items, :name, :string
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120111134754)
2
- class AddUseCustomUrlNameToSpudPages < ActiveRecord::Migration
2
+ class AddUseCustomUrlNameToSpudPages < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_pages, :use_custom_url_name, :boolean, default: false
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120118141852)
2
- class AddNotesToSpudPages < ActiveRecord::Migration
2
+ class AddNotesToSpudPages < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_pages, :notes, :text
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120126232428)
2
- class AddMenuIdToSpudMenuItems < ActiveRecord::Migration
2
+ class AddMenuIdToSpudMenuItems < ActiveRecord::Migration[4.2]
3
3
 
4
4
  def change
5
5
  add_column :spud_menu_items, :spud_menu_id, :integer
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120128163601)
2
- class AddClassesToSpudMenuItems < ActiveRecord::Migration
2
+ class AddClassesToSpudMenuItems < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_menu_items, :classes, :string
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120329132314)
2
- class AddSiteIdToSpudPages < ActiveRecord::Migration
2
+ class AddSiteIdToSpudPages < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_pages, :site_id, :integer
5
5
  add_index :spud_pages, :site_id
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120329132322)
2
- class AddSiteIdToSpudTemplates < ActiveRecord::Migration
2
+ class AddSiteIdToSpudTemplates < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_templates, :site_id, :integer
5
5
  add_index :spud_templates, :site_id
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120329132330)
2
- class AddSiteIdToSpudMenus < ActiveRecord::Migration
2
+ class AddSiteIdToSpudMenus < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_menus, :site_id, :integer
5
5
  add_index :spud_menus, :site_id
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120510195151)
2
- class CreateSpudPagePartialRevisions < ActiveRecord::Migration
2
+ class CreateSpudPagePartialRevisions < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_page_partial_revisions do |t|
5
5
  t.string :name
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120911190030)
2
- class AddSymbolNameToSpudPagePartials < ActiveRecord::Migration
2
+ class AddSymbolNameToSpudPagePartials < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_page_partials, :symbol_name, :string
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20120912121313)
2
- class ModifySiteIdForSpudPages < ActiveRecord::Migration
2
+ class ModifySiteIdForSpudPages < ActiveRecord::Migration[4.2]
3
3
  def up
4
4
  change_column :spud_pages, :site_id, :integer, default: 0, null: false
5
5
  change_column :spud_templates, :site_id, :integer, default: 0, null: false
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20121016233715)
2
- class AddContentProcessedToSpudPagePartials < ActiveRecord::Migration
2
+ class AddContentProcessedToSpudPagePartials < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_page_partials, :content_processed, :text
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20121112151110)
2
- class AddLayoutToSpudPages < ActiveRecord::Migration
2
+ class AddLayoutToSpudPages < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_pages, :layout, :string
5
5
 
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20121119025608)
2
- class CreateSpudSnippets < ActiveRecord::Migration
2
+ class CreateSpudSnippets < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :spud_snippets do |t|
5
5
  t.string :name
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20150108162839)
2
- class RemoveSiteIdFromCmsTables < ActiveRecord::Migration
2
+ class RemoveSiteIdFromCmsTables < ActiveRecord::Migration[4.2]
3
3
  def up
4
4
  remove_column :spud_menus, :site_id
5
5
  remove_column :spud_pages, :site_id
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_core (originally 20150610143438)
2
- class AddRequiresPasswordChangeToSpudUsers < ActiveRecord::Migration
2
+ class AddRequiresPasswordChangeToSpudUsers < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_users, :requires_password_change, :boolean, default: false
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_cms (originally 20150622161403)
2
- class AddTitleTagToSpudPage < ActiveRecord::Migration
2
+ class AddTitleTagToSpudPage < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_column :spud_pages, :page_title, :string
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from tb_redirects (originally 20160211162513)
2
- class CreateTbRedirects < ActiveRecord::Migration
2
+ class CreateTbRedirects < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :tb_redirects do |t|
5
5
  t.string :owner_type
@@ -12,173 +12,166 @@
12
12
 
13
13
  ActiveRecord::Schema.define(version: 20160215180157) do
14
14
 
15
- create_table "spud_liquid_tags", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
16
- t.integer "attachment_id"
17
- t.string "attachment_type"
18
- t.string "tag_name"
19
- t.string "value"
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"
20
25
  t.datetime "created_at"
21
26
  t.datetime "updated_at"
22
- t.index ["tag_name", "value"], name: "index_spud_liquid_tags_on_tag_name_and_value", 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"
23
33
  end
24
34
 
25
- create_table "spud_menu_items", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
26
- t.string "parent_type"
27
- t.integer "parent_id"
28
- t.integer "item_type"
29
- t.integer "spud_page_id"
30
- t.integer "menu_order", default: 0
31
- t.string "url"
35
+ create_table "spud_menus", id: :serial, force: :cascade do |t|
36
+ t.string "name"
37
+ t.text "description"
32
38
  t.datetime "created_at"
33
39
  t.datetime "updated_at"
34
- t.string "name"
35
- t.integer "spud_menu_id"
36
- t.string "classes"
37
- t.index ["menu_order"], name: "index_spud_menu_items_on_menu_order", using: :btree
38
- t.index ["parent_type", "parent_id"], name: "index_spud_menu_items_on_parent_type_and_parent_id", using: :btree
39
- t.index ["spud_menu_id"], name: "index_spud_menu_items_on_spud_menu_id", using: :btree
40
40
  end
41
41
 
42
- create_table "spud_menus", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
43
- t.string "name"
44
- t.text "description", limit: 65535
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"
45
47
  t.datetime "created_at"
46
48
  t.datetime "updated_at"
49
+ t.index ["spud_page_id", "name"], name: "revision_idx"
47
50
  end
48
51
 
49
- create_table "spud_page_partial_revisions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
50
- t.string "name"
51
- t.text "content", limit: 65535
52
- t.string "format"
53
- t.integer "spud_page_id"
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.index ["spud_page_id", "name"], name: "revision_idx", 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"
57
62
  end
58
63
 
59
- create_table "spud_page_partials", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
60
- t.integer "spud_page_id"
61
- t.string "name"
62
- t.text "content", limit: 65535
63
- t.string "format"
64
- t.datetime "created_at"
65
- t.datetime "updated_at"
66
- t.string "symbol_name"
67
- t.text "content_processed", limit: 65535
68
- t.index ["spud_page_id"], name: "index_spud_page_partials_on_spud_page_id", using: :btree
69
- end
70
-
71
- create_table "spud_pages", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
72
- t.string "name"
73
- t.string "url_name"
64
+ create_table "spud_pages", id: :serial, force: :cascade do |t|
65
+ t.string "name"
66
+ t.string "url_name"
74
67
  t.datetime "publish_at"
75
- t.integer "created_by"
76
- t.integer "updated_by"
77
- t.string "format", default: "html"
78
- t.integer "spud_page_id"
79
- t.text "meta_description", limit: 65535
80
- t.string "meta_keywords"
81
- 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"
82
75
  t.datetime "created_at"
83
76
  t.datetime "updated_at"
84
- t.integer "visibility", default: 0
85
- t.boolean "published", default: true
86
- t.boolean "use_custom_url_name", default: false
87
- t.text "notes", limit: 65535
88
- t.string "layout"
89
- 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"
90
83
  end
91
84
 
92
- create_table "spud_permalinks", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
93
- t.string "url_name"
94
- t.string "attachment_type"
95
- 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"
96
89
  t.datetime "created_at"
97
90
  t.datetime "updated_at"
98
- t.integer "site_id", default: 0, null: false
99
- t.index ["attachment_type", "attachment_id"], name: "idx_permalink_attachment", using: :btree
100
- 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"
101
94
  end
102
95
 
103
- create_table "spud_permissions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
104
- t.string "name", null: false
105
- 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
106
99
  t.datetime "created_at"
107
100
  t.datetime "updated_at"
108
- 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
109
102
  end
110
103
 
111
- create_table "spud_role_permissions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
112
- t.integer "spud_role_id", null: false
113
- 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
114
107
  t.datetime "created_at"
115
108
  t.datetime "updated_at"
116
- t.index ["spud_permission_tag"], name: "index_spud_role_permissions_on_spud_permission_tag", using: :btree
117
- 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"
118
111
  end
119
112
 
120
- create_table "spud_roles", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
121
- t.string "name"
113
+ create_table "spud_roles", id: :serial, force: :cascade do |t|
114
+ t.string "name"
122
115
  t.datetime "created_at"
123
116
  t.datetime "updated_at"
124
117
  end
125
118
 
126
- create_table "spud_snippets", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
127
- t.string "name"
128
- t.text "content", limit: 65535
129
- t.string "format"
130
- 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"
131
124
  t.datetime "created_at"
132
125
  t.datetime "updated_at"
133
- t.index ["name"], name: "index_spud_snippets_on_name", using: :btree
126
+ t.index ["name"], name: "index_spud_snippets_on_name"
134
127
  end
135
128
 
136
- create_table "spud_user_settings", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
137
- t.integer "spud_user_id"
138
- t.string "key"
139
- 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"
140
133
  t.datetime "created_at"
141
134
  t.datetime "updated_at"
142
135
  end
143
136
 
144
- create_table "spud_users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
145
- t.string "first_name"
146
- t.string "last_name"
147
- t.boolean "super_admin"
148
- t.string "login", null: false
149
- t.string "email", null: false
150
- t.string "crypted_password", null: false
151
- t.string "password_salt", null: false
152
- t.string "persistence_token", null: false
153
- t.string "single_access_token", null: false
154
- t.string "perishable_token", null: false
155
- t.integer "login_count", default: 0, null: false
156
- 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
157
150
  t.datetime "last_request_at"
158
151
  t.datetime "current_login_at"
159
152
  t.datetime "last_login_at"
160
- t.string "current_login_ip"
161
- t.string "last_login_ip"
153
+ t.string "current_login_ip"
154
+ t.string "last_login_ip"
162
155
  t.datetime "created_at"
163
156
  t.datetime "updated_at"
164
- t.string "time_zone"
165
- t.integer "spud_role_id"
166
- t.boolean "requires_password_change", default: false
167
- t.index ["email"], name: "index_spud_users_on_email", using: :btree
168
- t.index ["login"], name: "index_spud_users_on_login", using: :btree
169
- 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"
170
163
  end
171
164
 
172
- create_table "tb_redirects", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
173
- t.string "owner_type"
174
- t.integer "owner_id"
175
- t.string "source", null: false
176
- t.string "destination", null: false
177
- t.string "created_by"
178
- t.datetime "created_at", null: false
179
- t.datetime "updated_at", null: false
180
- t.index ["owner_type", "owner_id"], name: "index_tb_redirects_on_owner_type_and_owner_id", using: :btree
181
- 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
182
175
  end
183
176
 
184
177
  end