tb_cms 1.3.beta1 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +0 -9
  3. data/app/assets/javascripts/admin/cms/menu_items.js +12 -6
  4. data/app/assets/javascripts/admin/cms/pages.js +3 -0
  5. data/app/controllers/cms/sitemaps_controller.rb +1 -1
  6. data/app/controllers/pages_controller.rb +4 -4
  7. data/app/helpers/cms/application_helper.rb +4 -4
  8. data/app/models/spud_menu_item.rb +3 -3
  9. data/app/models/spud_page.rb +21 -10
  10. data/app/models/spud_page_partial.rb +3 -20
  11. data/app/models/spud_snippet.rb +1 -4
  12. data/app/views/admin/pages/show.html.erb +12 -15
  13. data/app/views/pages/show.html.erb +2 -2
  14. data/db/migrate/20120101192412_create_spud_pages.rb +1 -1
  15. data/db/migrate/20120101193138_create_spud_menus.rb +1 -1
  16. data/db/migrate/20120101193255_create_spud_menu_items.rb +1 -1
  17. data/db/migrate/20120101194124_create_spud_templates.rb +1 -1
  18. data/db/migrate/20120103034659_create_spud_page_partials.rb +1 -1
  19. data/db/migrate/20120104194032_add_visibility_to_spud_pages.rb +1 -1
  20. data/db/migrate/20120107181337_add_menu_name_to_spud_menu_items.rb +1 -1
  21. data/db/migrate/20120111134754_add_use_custom_url_name_to_spud_pages.rb +1 -1
  22. data/db/migrate/20120118141852_add_notes_to_spud_pages.rb +1 -1
  23. data/db/migrate/20120126232428_add_menu_id_to_spud_menu_items.rb +1 -1
  24. data/db/migrate/20120128163601_add_classes_to_spud_menu_items.rb +1 -1
  25. data/db/migrate/20120329132314_add_site_id_to_spud_pages.rb +1 -1
  26. data/db/migrate/20120329132322_add_site_id_to_spud_templates.rb +1 -1
  27. data/db/migrate/20120329132330_add_site_id_to_spud_menus.rb +1 -1
  28. data/db/migrate/20120510195151_create_spud_page_partial_revisions.rb +1 -1
  29. data/db/migrate/20120911190030_add_symbol_name_to_spud_page_partials.rb +1 -1
  30. data/db/migrate/20120912121313_modify_site_id_for_spud_pages.rb +1 -1
  31. data/db/migrate/20121016233715_add_content_processed_to_spud_page_partials.rb +1 -1
  32. data/db/migrate/20121112151110_add_layout_to_spud_pages.rb +1 -1
  33. data/db/migrate/20121119025608_create_spud_snippets.rb +1 -1
  34. data/db/migrate/20150108162839_remove_site_id_from_cms_tables.rb +1 -1
  35. data/db/migrate/20150622161403_add_title_tag_to_spud_page.rb +1 -1
  36. data/lib/spud_cms/engine.rb +4 -15
  37. data/lib/spud_cms/template_parser.rb +2 -2
  38. data/lib/spud_cms/version.rb +1 -1
  39. data/lib/tb_cms.rb +0 -1
  40. data/spec/controllers/admin/menu_items_controller_spec.rb +18 -18
  41. data/spec/controllers/admin/menus_controller_spec.rb +9 -9
  42. data/spec/controllers/admin/pages_controller_spec.rb +9 -9
  43. data/spec/controllers/pages_controller_spec.rb +5 -5
  44. data/spec/dummy/app/controllers/application_controller.rb +1 -1
  45. data/spec/dummy/config/application.rb +1 -1
  46. data/spec/dummy/config/database.yml +3 -6
  47. data/spec/dummy/config/environments/development.rb +2 -2
  48. data/spec/dummy/db/migrate/20141231214446_create_spud_admin_permissions.tb_core.rb +1 -1
  49. data/spec/dummy/db/migrate/20141231214447_create_spud_users.tb_core.rb +1 -1
  50. data/spec/dummy/db/migrate/20141231214448_add_time_zone_to_spud_user.tb_core.rb +1 -1
  51. data/spec/dummy/db/migrate/20141231214449_add_scope_to_spud_admin_permissions.tb_core.rb +1 -1
  52. data/spec/dummy/db/migrate/20141231214450_create_spud_user_settings.tb_core.rb +1 -1
  53. data/spec/dummy/db/migrate/20141231214451_create_spud_roles.tb_core.rb +1 -1
  54. data/spec/dummy/db/migrate/20141231214452_create_spud_permissions.tb_core.rb +1 -1
  55. data/spec/dummy/db/migrate/20141231214453_create_spud_role_permissions.tb_core.rb +1 -1
  56. data/spec/dummy/db/migrate/20141231214454_drop_spud_admin_permissions.tb_core.rb +1 -1
  57. data/spec/dummy/db/migrate/20141231214455_create_spud_permalinks.tb_permalinks.rb +1 -1
  58. data/spec/dummy/db/migrate/20141231214456_add_site_id_to_spud_permalinks.tb_permalinks.rb +1 -1
  59. data/spec/dummy/db/migrate/20141231214457_modify_site_id_for_spud_permalinks.tb_permalinks.rb +1 -1
  60. data/spec/dummy/db/migrate/20141231214459_create_spud_pages.tb_cms.rb +1 -1
  61. data/spec/dummy/db/migrate/20141231214460_create_spud_menus.tb_cms.rb +1 -1
  62. data/spec/dummy/db/migrate/20141231214461_create_spud_menu_items.tb_cms.rb +1 -1
  63. data/spec/dummy/db/migrate/20141231214462_create_spud_templates.tb_cms.rb +1 -1
  64. data/spec/dummy/db/migrate/20141231214463_create_spud_page_partials.tb_cms.rb +1 -1
  65. data/spec/dummy/db/migrate/20141231214464_add_visibility_to_spud_pages.tb_cms.rb +1 -1
  66. data/spec/dummy/db/migrate/20141231214465_add_menu_name_to_spud_menu_items.tb_cms.rb +1 -1
  67. data/spec/dummy/db/migrate/20141231214466_add_use_custom_url_name_to_spud_pages.tb_cms.rb +1 -1
  68. data/spec/dummy/db/migrate/20141231214467_add_notes_to_spud_pages.tb_cms.rb +1 -1
  69. data/spec/dummy/db/migrate/20141231214468_add_menu_id_to_spud_menu_items.tb_cms.rb +1 -1
  70. data/spec/dummy/db/migrate/20141231214469_add_classes_to_spud_menu_items.tb_cms.rb +1 -1
  71. data/spec/dummy/db/migrate/20141231214470_add_site_id_to_spud_pages.tb_cms.rb +1 -1
  72. data/spec/dummy/db/migrate/20141231214471_add_site_id_to_spud_templates.tb_cms.rb +1 -1
  73. data/spec/dummy/db/migrate/20141231214472_add_site_id_to_spud_menus.tb_cms.rb +1 -1
  74. data/spec/dummy/db/migrate/20141231214473_create_spud_page_partial_revisions.tb_cms.rb +1 -1
  75. data/spec/dummy/db/migrate/20141231214474_add_symbol_name_to_spud_page_partials.tb_cms.rb +1 -1
  76. data/spec/dummy/db/migrate/20141231214475_modify_site_id_for_spud_pages.tb_cms.rb +1 -1
  77. data/spec/dummy/db/migrate/20141231214476_add_content_processed_to_spud_page_partials.tb_cms.rb +1 -1
  78. data/spec/dummy/db/migrate/20141231214477_add_layout_to_spud_pages.tb_cms.rb +1 -1
  79. data/spec/dummy/db/migrate/20141231214479_create_spud_snippets.tb_cms.rb +1 -1
  80. data/spec/dummy/db/migrate/20150108164814_remove_site_id_from_cms_tables.tb_cms.rb +1 -1
  81. data/spec/dummy/db/migrate/20150911185843_add_requires_password_change_to_spud_users.tb_core.rb +1 -1
  82. data/spec/dummy/db/migrate/20150911185844_add_title_tag_to_spud_page.tb_cms.rb +1 -1
  83. data/spec/dummy/db/migrate/20160215180157_create_tb_redirects.tb_redirects.rb +1 -1
  84. data/spec/dummy/db/schema.rb +138 -145
  85. data/spec/helpers/cms/application_helper_spec.rb +37 -37
  86. data/spec/models/spud_menu_item_spec.rb +4 -4
  87. data/spec/models/spud_page_partial_spec.rb +5 -5
  88. data/spec/models/spud_page_spec.rb +20 -12
  89. data/spec/rails_helper.rb +1 -1
  90. metadata +68 -95
  91. data/db/migrate/20121112212113_create_spud_page_liquid_tags.rb +0 -11
  92. data/db/migrate/20121119030136_change_liquid_tags_to_polymorphic.rb +0 -17
  93. data/db/migrate/20140110142037_drop_spud_page_liquid_tags.rb +0 -31
  94. data/lib/spud_cms/liquid_snippet.rb +0 -27
  95. data/spec/dummy/db/migrate/20141231214458_create_tb_liquid_spud_liquid_tags.tb_liquid.rb +0 -13
  96. data/spec/dummy/db/migrate/20141231214478_create_spud_page_liquid_tags.tb_cms.rb +0 -12
  97. data/spec/dummy/db/migrate/20141231214480_change_liquid_tags_to_polymorphic.tb_cms.rb +0 -18
  98. data/spec/dummy/db/migrate/20141231214481_drop_spud_page_liquid_tags.tb_cms.rb +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: de4396854d57732f8a52e8efbace10d73fdcaded
4
- data.tar.gz: 93a220547d65d8c0a94fb9123ae346409a782391
2
+ SHA256:
3
+ metadata.gz: d674e42a14812fcc99fc125a85514ba33f016752e5cdcc7c4d7319e841505ea3
4
+ data.tar.gz: 5b1669484dff7f06e78db700051107954229d95ec11819a3d05144d5929fe050
5
5
  SHA512:
6
- metadata.gz: 8857e4dabfd684a60633fa40e179a1c596cc2efa9d3c5ad9485020e37959bcfdff74971aa1faf41d18ed01900b04ccfca81d8ad7cdbe78e6a6dda82c063cb737
7
- data.tar.gz: 673da85578b647fe67ce656dea4908d42658d274f6157759834d97acf703978df27166926cc1d28a157800758aecc22657f4854289608a1ffa41a194efb35e2c
6
+ metadata.gz: b819655bcdbb65fc611da5ddbba4a159dcb9a495d05fbcbd46b7c8d04351d014b8d974b0889b2fb0b53162a089658b99cbe69a190b88916699fbfa97e9240a59
7
+ data.tar.gz: 6583b6a1d64056748b9252381e51d6cfda5949c7b119ed0a731e7b5e382cb9522e0e6355d1a9392ba36ed50509d2c3b9c233ed389f037a16a1d77e42f392e88a
data/README.md CHANGED
@@ -72,12 +72,6 @@ Create a controller concern at `app/controllers/concerns/spud_cms_layout_actions
72
72
 
73
73
  If you ran the `spud:cms:layout` generator described earlier, the concern and empty action would have been created for you automatically.
74
74
 
75
- ## Using Liquid Templates
76
-
77
- Pages use the [liquid](https://github.com/Shopify/liquid) template syntax engine created by Shopify. This allows you to easily inject variables into your pages in the page editor. Example:
78
-
79
- <h2>{{page.name}}</h2>
80
-
81
75
  ## Using Menus
82
76
 
83
77
  A lot of cms engines allow you to render your navigation links in a ul block by using your page tree structure. In a lot of cases this is insufficient as some sites have urls that redirect to pages outside of your cms. This is where menus come in. They can be built in the admin control panel.
@@ -105,6 +99,3 @@ TB CMS uses RSpec for testing. Get the tests running with a few short commands:
105
99
  rspec spec
106
100
 
107
101
  After the tests have completed the current code coverage stats is available by opening ```/coverage/index.html``` in a browser.
108
-
109
-
110
-
@@ -3,7 +3,7 @@ spud.admin.cms.menu_items = {};
3
3
  (function() {
4
4
  var menu_items = spud.admin.cms.menu_items;
5
5
  var val;
6
-
6
+
7
7
  var setUrl = function(){
8
8
  return '/admin/menus/'+ val +'/menu_items/update_sort';
9
9
  };
@@ -35,25 +35,31 @@ spud.admin.cms.menu_items = {};
35
35
  });
36
36
  val = $("#menu-id").val();
37
37
  //Update order of menuItems
38
- $.ajax(setUrl(), {
39
- method: 'PUT',
38
+ $.ajax(setUrl(), {
39
+ method: 'PUT',
40
40
  data: {
41
41
  order: sortArr
42
- },
42
+ },
43
43
  dataType: "json",
44
44
  success: function(data, status, jqXHR) {
45
45
  menu_items.updateStatus(200, '0px 0px 26px 2px rgba(4, 252, -49, 0.59)');
46
46
  },
47
47
  error: function(XMLHttpRequest, textStatus, errorThrown) {
48
48
  menu_items.updateStatus(100, '0px 0px 26px 2px rgba(255, 0, 40, 0.59)');
49
- alert("Status: " + textStatus); alert("Error: " + errorThrown);
50
- }
49
+ alert("Status: " + textStatus); alert("Error: " + errorThrown);
50
+ }
51
51
  });
52
52
  }
53
53
  });
54
54
  };
55
55
 
56
56
  menu_items.init = function() {
57
+ return
58
+
59
+ // Sortable relies on jQuery UI, which has been removed
60
+ // This code needs to migrate to sortable.js
61
+ // See: https://bitbucket.org/moser-inc/tb_core/commits/e6252b6aa508e103b54df7e563ecfa2d2ec26c24
62
+ //
57
63
  $("#sort tbody").sortable({
58
64
  helper: fixHelper,
59
65
  cursor: "move",
@@ -24,6 +24,9 @@ var clickedPreviewButton = function(e){
24
24
  form.target = '';
25
25
  form.onSubmit = null;
26
26
  previewInput.val(0);
27
+ form.querySelectorAll('.btn').forEach(function(btn) {
28
+ btn.disabled = false;
29
+ });
27
30
  }, 200);
28
31
  };
29
32
 
@@ -1,4 +1,4 @@
1
- class Cms::SitemapsController < Spud::ApplicationController
1
+ class Cms::SitemapsController < TbCore::ApplicationController
2
2
  respond_to :xml
3
3
  def show
4
4
  @pages = SpudPage.published_pages.viewable.order(:spud_page_id)
@@ -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
@@ -34,11 +34,11 @@ class PagesController < ApplicationController
34
34
  private
35
35
 
36
36
  def render_404
37
- raise Spud::NotFoundError, item: 'page'
38
- end
37
+ raise TbCore::NotFoundError, item: 'page'
38
+ end
39
39
 
40
40
  def set_default_content_type
41
41
  request.format = :html if params[:format].blank?
42
- end
42
+ end
43
43
 
44
44
  end
@@ -85,8 +85,8 @@ module Cms::ApplicationHelper
85
85
  menu_id = menu.id
86
86
  end
87
87
 
88
- cache(['sp_list_menu', menu, options]) do
89
- link_options = options[:link_options] if options.key?(:link_options)
88
+ Rails.cache.fetch(['sp_list_menu', menu, options]) do
89
+ link_options = options[:link_options] if options.has_key?(:link_options)
90
90
 
91
91
  start_menu_item = options[:start_menu_item_id] if options.key?(:start_menu_item_id)
92
92
  content = if options.key?(:id)
@@ -136,8 +136,8 @@ module Cms::ApplicationHelper
136
136
 
137
137
  content += '</ul>'
138
138
 
139
- concat content.html_safe
140
- end
139
+ content
140
+ end.html_safe
141
141
  end
142
142
 
143
143
  def sp_menu_with_seperator(options = {})
@@ -1,7 +1,7 @@
1
1
  class SpudMenuItem < ActiveRecord::Base
2
- belongs_to :parent, polymorphic: true
3
- belongs_to :spud_menu, touch: true
4
- belongs_to :spud_page
2
+ belongs_to :parent, polymorphic: true, required: false
3
+ belongs_to :spud_menu, touch: true, required: false
4
+ belongs_to :spud_page, required: false
5
5
  has_many :spud_menu_items, as: :parent, dependent: :destroy
6
6
 
7
7
  validates :name, presence: true
@@ -2,13 +2,19 @@ class SpudPage < ActiveRecord::Base
2
2
  include CmsDeprecatedMultisite
3
3
  include TbRedirects::HasRedirects
4
4
 
5
- spud_searchable
6
- belongs_to :spud_page
5
+ belongs_to :spud_page,
6
+ required: false
7
7
  has_many :spud_page_partial_revisions
8
8
  has_many :spud_pages, dependent: :nullify
9
9
  has_many :spud_page_partials, dependent: :destroy
10
- belongs_to :created_by_user, class_name: 'SpudUser', foreign_key: :created_by
11
- belongs_to :updated_by_user, class_name: 'SpudUser', foreign_key: :updated_by
10
+ belongs_to :created_by_user,
11
+ class_name: 'SpudUser',
12
+ foreign_key: :created_by,
13
+ required: false
14
+ belongs_to :updated_by_user,
15
+ class_name: 'SpudUser',
16
+ foreign_key: :updated_by,
17
+ required: false
12
18
 
13
19
  before_validation :generate_url_name
14
20
  validates :name, presence: true, uniqueness: { scope: :spud_page_id }
@@ -22,11 +28,12 @@ class SpudPage < ActiveRecord::Base
22
28
  scope :viewable, -> { where(visibility: 0) }
23
29
 
24
30
  def full_content_processed
31
+ ActiveSupport::Deprecation.warn('#full_content_processed is deprecated; use #full_content instead.')
25
32
  spud_page_partials.collect(&:content_processed).join(' ')
26
33
  end
27
34
 
28
- def to_liquid
29
- return { 'name' => name, 'url_name' => url_name }
35
+ def full_content
36
+ spud_page_partials.collect(&:content).join(' ')
30
37
  end
31
38
 
32
39
  # Returns an array of pages in order of heirarchy
@@ -43,7 +50,7 @@ class SpudPage < ActiveRecord::Base
43
50
  if filter.blank? || c.id != filter.id
44
51
  list << [Array.new(level) { '- ' }.join('') + c.name, c[value]]
45
52
  list += options_tree_for_page(collection: collection, parent_id: c.id, level: level + 1, filter: filter)
46
- end
53
+ end
47
54
  end
48
55
  return list
49
56
  end
@@ -52,6 +59,10 @@ class SpudPage < ActiveRecord::Base
52
59
  return visibility == 1
53
60
  end
54
61
 
62
+ def self.find_ignoring_case(url_name)
63
+ find_by(arel_table[:url_name].matches(url_name))
64
+ end
65
+
55
66
  private
56
67
 
57
68
  def generate_url_name
@@ -65,13 +76,13 @@ class SpudPage < ActiveRecord::Base
65
76
  end
66
77
 
67
78
  def create_redirect_if_necessary
68
- if url_name_changed?
69
- TbRedirect.create_smart(source: "/#{url_name_was}",
79
+ if saved_change_to_attribute?(:url_name)
80
+ TbRedirect.create_smart(source: "/#{attribute_before_last_save(:url_name)}",
70
81
  destination: "/#{url_name}",
71
82
  created_by: 'cms',
72
83
  owner: self)
73
84
  end
74
- return true
85
+ true
75
86
  end
76
87
 
77
88
  end
@@ -1,10 +1,8 @@
1
1
  class SpudPagePartial < ActiveRecord::Base
2
2
  belongs_to :spud_page, touch: true
3
- has_many :spud_liquid_tags, as: :attachment, dependent: :destroy
4
3
  validates :name, presence: true
5
4
  before_save :maintain_revisions
6
5
  before_save :update_symbol_name
7
- acts_as_tb_liquid_content
8
6
 
9
7
  def update_symbol_name
10
8
  self.symbol_name = name.parameterize.underscore
@@ -14,24 +12,9 @@ class SpudPagePartial < ActiveRecord::Base
14
12
  return @symbol_name || name.parameterize.underscore
15
13
  end
16
14
 
17
- def postprocess_content
18
- @_template = Liquid::Template.parse(content)
19
- self.content_processed = @_template.render('page' => spud_page)
20
- end
21
-
22
- def content_processed=(content)
23
- self[:content_processed] = content
24
- end
25
-
26
15
  def content_processed
27
- if self[:content_processed].blank?
28
- if new_record?
29
- self.content_processed = postprocess_content()
30
- else
31
- update_column(:content_processed, postprocess_content)
32
- end
33
- end
34
- return self[:content_processed]
16
+ ActiveSupport::Deprecation.warn('#content_processed is deprecated; use #content instead.')
17
+ content
35
18
  end
36
19
 
37
20
  def maintain_revisions
@@ -44,7 +27,7 @@ class SpudPagePartial < ActiveRecord::Base
44
27
  revision_bye = SpudPagePartialRevision.where(spud_page_id: spud_page_id, name: name).order('created_at ASC').first
45
28
  revision_bye.destroy unless revision_bye.blank?
46
29
  end
47
- end
30
+ end
48
31
  return true
49
32
  end
50
33
  end
@@ -4,11 +4,8 @@ class SpudSnippet < ActiveRecord::Base
4
4
  validates :name, presence: true
5
5
  validates :name, uniqueness: true
6
6
 
7
- acts_as_tb_liquid_content
8
-
9
7
  def postprocess_content
10
- template = Liquid::Template.parse(content)
11
- self.content_processed = template.render()
8
+ content
12
9
  end
13
10
 
14
11
  def content_processed=(content)
@@ -1,20 +1,17 @@
1
-
2
1
  <%=content_for :head do%>
3
- <meta name="description" content="<%=@page.meta_description%>" />
4
-
5
- <meta name="keywords" content="<%=@page.meta_keywords%>" />
2
+ <meta name="description" content="<%=@page.meta_description%>" />
3
+ <meta name="keywords" content="<%=@page.meta_keywords%>" />
6
4
  <% end %>
7
5
 
8
- <%if !@inline.blank?%>
9
- <%=render :inline => @inline%>
6
+ <% if !@inline.blank? %>
7
+ <%= render :inline => @inline %>
10
8
  <% end %>
11
- <%@page.spud_page_partials.each do |page_partial|%>
12
-
13
- <%if(page_partial.name.downcase == 'body' && Spud::Cms.yield_body_as_content_block == false)%>
14
- <%=page_partial.postprocess_content.html_safe%>
15
- <%else%>
16
- <%=content_for page_partial.name.parameterize.underscore.to_sym do%>
17
- <%=page_partial.postprocess_content.html_safe%>
18
- <% end %>
19
- <% end %>
9
+ <% @page.spud_page_partials.each do |page_partial| %>
10
+ <% if page_partial.name.downcase == 'body' && Spud::Cms.yield_body_as_content_block == false %>
11
+ <%= page_partial.content.html_safe %>
12
+ <% else %>
13
+ <%= content_for page_partial.name.parameterize.underscore.to_sym do %>
14
+ <%= page_partial.content.html_safe %>
15
+ <% end %>
16
+ <% end %>
20
17
  <% end %>
@@ -17,12 +17,12 @@
17
17
  <% @page.spud_page_partials.each do |page_partial| %>
18
18
  <% if(page_partial.name.match(/^body$/i) && Spud::Cms.yield_body_as_content_block == false) %>
19
19
  <% cache(page_partial) do %>
20
- <%= page_partial.content_processed.html_safe %>
20
+ <%= page_partial.content.html_safe %>
21
21
  <% end %>
22
22
  <% else%>
23
23
  <%= content_for page_partial.symbol_name.to_sym do %>
24
24
  <% cache(page_partial) do %>
25
- <%= page_partial.content_processed.html_safe %>
25
+ <%= page_partial.content.html_safe %>
26
26
  <% end %>
27
27
  <% end %>
28
28
  <% end %>
@@ -1,4 +1,4 @@
1
- class CreateSpudPages < ActiveRecord::Migration
1
+ class CreateSpudPages < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spud_pages do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateSpudMenus < ActiveRecord::Migration
1
+ class CreateSpudMenus < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spud_menus do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateSpudMenuItems < ActiveRecord::Migration
1
+ class CreateSpudMenuItems < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spud_menu_items do |t|
4
4
  t.string :parent_type
@@ -1,4 +1,4 @@
1
- class CreateSpudTemplates < ActiveRecord::Migration
1
+ class CreateSpudTemplates < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spud_templates do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateSpudPagePartials < ActiveRecord::Migration
1
+ class CreateSpudPagePartials < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spud_page_partials do |t|
4
4
  t.integer :spud_page_id
@@ -1,4 +1,4 @@
1
- class AddVisibilityToSpudPages < ActiveRecord::Migration
1
+ class AddVisibilityToSpudPages < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spud_pages, :visibility, :integer,:default => 0
4
4
  add_column :spud_pages, :published, :boolean,:default => true
@@ -1,4 +1,4 @@
1
- class AddMenuNameToSpudMenuItems < ActiveRecord::Migration
1
+ class AddMenuNameToSpudMenuItems < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spud_menu_items, :name, :string
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddUseCustomUrlNameToSpudPages < ActiveRecord::Migration
1
+ class AddUseCustomUrlNameToSpudPages < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spud_pages, :use_custom_url_name, :boolean,:default => false
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddNotesToSpudPages < ActiveRecord::Migration
1
+ class AddNotesToSpudPages < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spud_pages, :notes, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddMenuIdToSpudMenuItems < ActiveRecord::Migration
1
+ class AddMenuIdToSpudMenuItems < ActiveRecord::Migration[4.2]
2
2
 
3
3
  def change
4
4
  add_column :spud_menu_items, :spud_menu_id, :integer
@@ -1,4 +1,4 @@
1
- class AddClassesToSpudMenuItems < ActiveRecord::Migration
1
+ class AddClassesToSpudMenuItems < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spud_menu_items, :classes, :string
4
4
 
@@ -1,4 +1,4 @@
1
- class AddSiteIdToSpudPages < ActiveRecord::Migration
1
+ class AddSiteIdToSpudPages < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spud_pages, :site_id, :integer
4
4
  add_index :spud_pages,:site_id
@@ -1,4 +1,4 @@
1
- class AddSiteIdToSpudTemplates < ActiveRecord::Migration
1
+ class AddSiteIdToSpudTemplates < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spud_templates, :site_id, :integer
4
4
  add_index :spud_templates,:site_id
@@ -1,4 +1,4 @@
1
- class AddSiteIdToSpudMenus < ActiveRecord::Migration
1
+ class AddSiteIdToSpudMenus < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spud_menus, :site_id, :integer
4
4
  add_index :spud_menus,:site_id
@@ -1,4 +1,4 @@
1
- class CreateSpudPagePartialRevisions < ActiveRecord::Migration
1
+ class CreateSpudPagePartialRevisions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :spud_page_partial_revisions do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class AddSymbolNameToSpudPagePartials < ActiveRecord::Migration
1
+ class AddSymbolNameToSpudPagePartials < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :spud_page_partials, :symbol_name, :string
4
4
  end