alchemy_cms 4.0.0.beta → 4.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -7
  3. data/CHANGELOG.md +23 -0
  4. data/README.md +1 -1
  5. data/alchemy_cms.gemspec +1 -1
  6. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +2 -2
  7. data/app/assets/stylesheets/alchemy/_extends.scss +3 -5
  8. data/app/assets/stylesheets/alchemy/_mixins.scss +1 -1
  9. data/app/assets/stylesheets/alchemy/base.scss +2 -2
  10. data/app/assets/stylesheets/alchemy/buttons.scss +2 -2
  11. data/app/assets/stylesheets/alchemy/dialogs.scss +3 -3
  12. data/app/assets/stylesheets/alchemy/elements.scss +2 -2
  13. data/app/assets/stylesheets/alchemy/image_library.scss +10 -10
  14. data/app/assets/stylesheets/alchemy/jquery.datetimepicker.scss +2 -2
  15. data/app/assets/stylesheets/alchemy/lists.scss +2 -1
  16. data/app/assets/stylesheets/alchemy/sitemap.scss +1 -16
  17. data/app/assets/stylesheets/alchemy/tables.scss +1 -1
  18. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +4 -4
  19. data/app/controllers/alchemy/admin/attachments_controller.rb +10 -10
  20. data/app/controllers/alchemy/admin/base_controller.rb +10 -19
  21. data/app/controllers/alchemy/admin/clipboard_controller.rb +20 -7
  22. data/app/controllers/alchemy/admin/contents_controller.rb +5 -19
  23. data/app/controllers/alchemy/admin/dashboard_controller.rb +5 -3
  24. data/app/controllers/alchemy/admin/elements_controller.rb +7 -1
  25. data/app/controllers/alchemy/admin/essence_files_controller.rb +2 -2
  26. data/app/controllers/alchemy/admin/essence_pictures_controller.rb +8 -13
  27. data/app/controllers/alchemy/admin/languages_controller.rb +2 -0
  28. data/app/controllers/alchemy/admin/layoutpages_controller.rb +2 -0
  29. data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +2 -0
  30. data/app/controllers/alchemy/admin/pages_controller.rb +3 -1
  31. data/app/controllers/alchemy/admin/pictures_controller.rb +11 -9
  32. data/app/controllers/alchemy/admin/resources_controller.rb +25 -4
  33. data/app/controllers/alchemy/admin/sites_controller.rb +2 -0
  34. data/app/controllers/alchemy/admin/tags_controller.rb +2 -0
  35. data/app/controllers/alchemy/admin/trash_controller.rb +2 -0
  36. data/app/controllers/alchemy/api/base_controller.rb +2 -0
  37. data/app/controllers/alchemy/api/contents_controller.rb +2 -0
  38. data/app/controllers/alchemy/api/elements_controller.rb +2 -0
  39. data/app/controllers/alchemy/api/pages_controller.rb +2 -0
  40. data/app/controllers/alchemy/attachments_controller.rb +2 -0
  41. data/app/controllers/alchemy/base_controller.rb +3 -1
  42. data/app/controllers/alchemy/elements_controller.rb +2 -0
  43. data/app/controllers/alchemy/messages_controller.rb +2 -0
  44. data/app/controllers/alchemy/pages_controller.rb +11 -2
  45. data/app/controllers/concerns/alchemy/admin/uploader_responses.rb +2 -0
  46. data/app/controllers/concerns/alchemy/legacy_page_redirects.rb +2 -0
  47. data/app/controllers/concerns/alchemy/locale_redirects.rb +2 -0
  48. data/app/controllers/concerns/alchemy/page_redirects.rb +2 -0
  49. data/app/controllers/concerns/alchemy/site_redirects.rb +2 -0
  50. data/app/helpers/alchemy/admin/attachments_helper.rb +2 -0
  51. data/app/helpers/alchemy/admin/base_helper.rb +2 -28
  52. data/app/helpers/alchemy/admin/contents_helper.rb +2 -0
  53. data/app/helpers/alchemy/admin/elements_helper.rb +2 -0
  54. data/app/helpers/alchemy/admin/essences_helper.rb +2 -0
  55. data/app/helpers/alchemy/admin/form_helper.rb +2 -0
  56. data/app/helpers/alchemy/admin/navigation_helper.rb +2 -0
  57. data/app/helpers/alchemy/admin/pages_helper.rb +2 -0
  58. data/app/helpers/alchemy/admin/pictures_helper.rb +2 -0
  59. data/app/helpers/alchemy/admin/tags_helper.rb +24 -76
  60. data/app/helpers/alchemy/base_helper.rb +2 -0
  61. data/app/helpers/alchemy/deprecated_pages_helper.rb +2 -0
  62. data/app/helpers/alchemy/elements_block_helper.rb +2 -0
  63. data/app/helpers/alchemy/elements_helper.rb +2 -0
  64. data/app/helpers/alchemy/essences_helper.rb +2 -0
  65. data/app/helpers/alchemy/pages_helper.rb +2 -0
  66. data/app/helpers/alchemy/url_helper.rb +2 -0
  67. data/app/mailers/alchemy/base_mailer.rb +2 -0
  68. data/app/mailers/alchemy/messages_mailer.rb +2 -0
  69. data/app/models/alchemy.rb +2 -0
  70. data/app/models/alchemy/attachment.rb +6 -4
  71. data/app/models/alchemy/cell.rb +4 -2
  72. data/app/models/alchemy/content.rb +7 -5
  73. data/app/models/alchemy/content/factory.rb +7 -7
  74. data/app/models/alchemy/element.rb +21 -28
  75. data/app/models/alchemy/element/definitions.rb +4 -2
  76. data/app/models/alchemy/element/element_contents.rb +3 -1
  77. data/app/models/alchemy/element/element_essences.rb +2 -0
  78. data/app/models/alchemy/element/presenters.rb +2 -0
  79. data/app/models/alchemy/element_to_page.rb +2 -0
  80. data/app/models/alchemy/essence_boolean.rb +2 -0
  81. data/app/models/alchemy/essence_date.rb +2 -0
  82. data/app/models/alchemy/essence_file.rb +2 -0
  83. data/app/models/alchemy/essence_html.rb +2 -0
  84. data/app/models/alchemy/essence_link.rb +6 -4
  85. data/app/models/alchemy/essence_picture.rb +13 -11
  86. data/app/models/alchemy/essence_picture_view.rb +2 -0
  87. data/app/models/alchemy/essence_richtext.rb +2 -0
  88. data/app/models/alchemy/essence_select.rb +3 -1
  89. data/app/models/alchemy/essence_text.rb +6 -4
  90. data/app/models/alchemy/folded_page.rb +4 -2
  91. data/app/models/alchemy/language.rb +9 -6
  92. data/app/models/alchemy/language/code.rb +2 -0
  93. data/app/models/alchemy/legacy_page_url.rb +3 -1
  94. data/app/models/alchemy/message.rb +2 -0
  95. data/app/models/alchemy/page.rb +3 -2
  96. data/app/models/alchemy/page/fixed_attributes.rb +2 -0
  97. data/app/models/alchemy/page/page_cells.rb +2 -0
  98. data/app/models/alchemy/page/page_elements.rb +3 -1
  99. data/app/models/alchemy/page/page_naming.rb +2 -0
  100. data/app/models/alchemy/page/page_natures.rb +2 -1
  101. data/app/models/alchemy/page/page_scopes.rb +2 -0
  102. data/app/models/alchemy/page/page_users.rb +2 -0
  103. data/app/models/alchemy/picture.rb +2 -0
  104. data/app/models/alchemy/picture/transformations.rb +2 -0
  105. data/app/models/alchemy/picture/url.rb +2 -0
  106. data/app/models/alchemy/site.rb +4 -2
  107. data/app/models/alchemy/site/layout.rb +2 -0
  108. data/app/models/alchemy/tag.rb +5 -2
  109. data/app/models/alchemy/tree_node.rb +2 -0
  110. data/app/serializers/alchemy/attachment_serializer.rb +2 -0
  111. data/app/serializers/alchemy/base_serializer.rb +2 -0
  112. data/app/serializers/alchemy/cell_serializer.rb +2 -0
  113. data/app/serializers/alchemy/content_serializer.rb +2 -0
  114. data/app/serializers/alchemy/element_serializer.rb +2 -0
  115. data/app/serializers/alchemy/essence_boolean_serializer.rb +2 -0
  116. data/app/serializers/alchemy/essence_date_serializer.rb +2 -0
  117. data/app/serializers/alchemy/essence_file_serializer.rb +2 -0
  118. data/app/serializers/alchemy/essence_html_serializer.rb +2 -0
  119. data/app/serializers/alchemy/essence_link_serializer.rb +2 -0
  120. data/app/serializers/alchemy/essence_picture_serializer.rb +2 -0
  121. data/app/serializers/alchemy/essence_richtext_serializer.rb +2 -0
  122. data/app/serializers/alchemy/essence_select_serializer.rb +2 -0
  123. data/app/serializers/alchemy/essence_text_serializer.rb +2 -0
  124. data/app/serializers/alchemy/legacy_element_serializer.rb +2 -0
  125. data/app/serializers/alchemy/page_serializer.rb +2 -0
  126. data/app/serializers/alchemy/page_tree_serializer.rb +2 -0
  127. data/app/serializers/alchemy/picture_serializer.rb +2 -0
  128. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +1 -1
  129. data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +1 -1
  130. data/app/views/alchemy/admin/attachments/_filter_bar.html.erb +1 -3
  131. data/app/views/alchemy/admin/attachments/_tag_list.html.erb +1 -1
  132. data/app/views/alchemy/admin/contents/_missing.html.erb +1 -1
  133. data/app/views/alchemy/admin/contents/create.js.erb +9 -13
  134. data/app/views/alchemy/admin/contents/new.html.erb +1 -1
  135. data/app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb +4 -4
  136. data/app/views/alchemy/admin/essence_files/assign.js.erb +1 -1
  137. data/app/views/alchemy/admin/essence_pictures/assign.js.erb +1 -1
  138. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -1
  139. data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +10 -7
  140. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +8 -6
  141. data/app/views/alchemy/admin/essence_pictures/update.js.erb +1 -1
  142. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
  143. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +4 -4
  144. data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +1 -3
  145. data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +1 -1
  146. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
  147. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +1 -1
  148. data/app/views/alchemy/admin/resources/_filter_bar.html.erb +1 -3
  149. data/app/views/alchemy/admin/resources/_tag_list.html.erb +1 -1
  150. data/app/views/alchemy/admin/uploader/_button.html.erb +1 -1
  151. data/app/views/alchemy/essences/_essence_file_editor.html.erb +2 -2
  152. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +2 -2
  153. data/app/views/alchemy/essences/shared/_essence_picture_tools.html.erb +3 -3
  154. data/app/views/alchemy/navigation/_renderer.html.erb +1 -2
  155. data/config/brakeman.ignore +65 -0
  156. data/db/migrate/20130827094554_alchemy_two_point_six.rb +1 -1
  157. data/db/migrate/20130828121054_remove_do_not_index_from_alchemy_essence_texts.rb +1 -1
  158. data/db/migrate/20130828121120_remove_do_not_index_from_alchemy_essence_richtexts.rb +1 -1
  159. data/db/migrate/20130918201742_add_published_at_to_alchemy_pages.rb +1 -1
  160. data/db/migrate/20150608204610_add_parent_element_id_to_alchemy_elements.rb +1 -1
  161. data/db/migrate/20150729151825_add_link_text_to_alchemy_essence_files.rb +1 -1
  162. data/db/migrate/20150906195818_add_locale_to_alchemy_languages.rb +1 -1
  163. data/db/migrate/20160108174834_add_timebased_publishing_columns_to_pages.rb +1 -1
  164. data/db/migrate/20160422195310_add_image_file_format_to_alchemy_pictures.rb +1 -1
  165. data/db/migrate/20160617224938_change_alchemy_pages_locked_to_locked_at.rb +1 -1
  166. data/db/migrate/20160912223112_add_index_to_alchemy_pages_rgt.rb +1 -1
  167. data/db/migrate/20160927205604_add_foreign_key_indices_and_null_constraints.rb +1 -1
  168. data/db/migrate/20160928080104_add_foreign_keys.rb +1 -1
  169. data/lib/alchemy/ability_helper.rb +2 -0
  170. data/lib/alchemy/admin/locale.rb +2 -0
  171. data/lib/alchemy/auth_accessors.rb +2 -0
  172. data/lib/alchemy/cache_digests/template_tracker.rb +2 -0
  173. data/lib/alchemy/config.rb +2 -0
  174. data/lib/alchemy/configuration_methods.rb +2 -0
  175. data/lib/alchemy/controller_actions.rb +2 -0
  176. data/lib/alchemy/deprecation.rb +3 -0
  177. data/lib/alchemy/errors.rb +2 -0
  178. data/lib/alchemy/essence.rb +2 -0
  179. data/lib/alchemy/filetypes.rb +2 -0
  180. data/lib/alchemy/forms/builder.rb +2 -0
  181. data/lib/alchemy/hints.rb +2 -0
  182. data/lib/alchemy/i18n.rb +2 -0
  183. data/lib/alchemy/logger.rb +2 -0
  184. data/lib/alchemy/modules.rb +2 -0
  185. data/lib/alchemy/name_conversions.rb +2 -0
  186. data/lib/alchemy/on_page_layout.rb +2 -0
  187. data/lib/alchemy/on_page_layout/callbacks_runner.rb +2 -0
  188. data/lib/alchemy/page_layout.rb +3 -1
  189. data/lib/alchemy/paths.rb +2 -0
  190. data/lib/alchemy/permissions.rb +2 -0
  191. data/lib/alchemy/picture_attributes.rb +2 -0
  192. data/lib/alchemy/resource.rb +2 -0
  193. data/lib/alchemy/resources_helper.rb +14 -12
  194. data/lib/alchemy/routing_constraints.rb +2 -0
  195. data/lib/alchemy/ssl_protection.rb +2 -0
  196. data/lib/alchemy/test_support/controller_requests.rb +20 -0
  197. data/lib/alchemy/test_support/essence_shared_examples.rb +3 -21
  198. data/lib/alchemy/tinymce.rb +2 -0
  199. data/lib/alchemy/touching.rb +2 -0
  200. data/lib/alchemy/upgrader/three_point_four.rb +20 -3
  201. data/lib/alchemy/userstamp.rb +2 -0
  202. data/lib/alchemy/version.rb +3 -1
  203. data/lib/alchemy_cms.rb +1 -0
  204. data/lib/tasks/alchemy/upgrade.rake +5 -1
  205. metadata +7 -5
@@ -1,5 +1,3 @@
1
- <% params_to_keep = [:size, :tagged_with, :query, :element_id, :options, :content_id, :_] %>
2
-
3
1
  <div id="filter_bar">
4
2
  <h2><%= Alchemy.t('Filter') %></h2>
5
3
  <%= select_tag(
@@ -19,7 +17,7 @@
19
17
  $(function() {
20
18
  $('#picture_filter').on('change', function(e) {
21
19
  var $this = $(this);
22
- var url = '<%= alchemy.admin_pictures_path(merge_params_only(params_to_keep)).html_safe %>';
20
+ var url = '<%= alchemy.admin_pictures_path(search_filter_params.except(:filter).to_h) %>';
23
21
  if ($this.data('remote') === true) {
24
22
  $.get(url, {filter: $this.val()}, null, 'script');
25
23
  } else {
@@ -6,6 +6,6 @@
6
6
  <% else %>
7
7
  <%= render partial: 'picture_to_assign',
8
8
  collection: @pictures,
9
- locals: {options: @options, size: @size} %>
9
+ locals: {options: options_from_params, size: @size} %>
10
10
  <%= paginate @pictures, theme: 'alchemy', remote: true %>
11
11
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <div class="picture_thumbnail assign_image_list_detail <%= size.blank? ? 'medium' : size %>" name="<%= picture_to_assign.name %>" id="picture_to_assign_<%= picture_to_assign.id %>">
2
- <% action_url = create_or_assign_url(picture_to_assign, @options.to_json) %>
2
+ <% action_url = create_or_assign_url(picture_to_assign, options) %>
3
3
  <%= link_to(
4
4
  image_tag(
5
5
  picture_to_assign.url(size: preview_size(size), flatten: true),
@@ -7,7 +7,7 @@
7
7
  <% if params[:tagged_with].present? %>
8
8
  <%= link_to(
9
9
  render_icon('delete-small') + Alchemy.t('Remove tag filter'),
10
- url_for(tag_list_params.delete_if { |k, v| k == "tagged_with" }.merge(action: 'index')),
10
+ url_for(search_filter_params.except(:tagged_with)),
11
11
  remote: request.xhr?,
12
12
  class: 'button small with_icon please_wait'
13
13
  ) %>
@@ -1,5 +1,3 @@
1
- <% params_to_keep = [:tagged_with, :q] %>
2
-
3
1
  <div id="filter_bar">
4
2
  <h2><%= Alchemy.t('Filter') %></h2>
5
3
  <%= select_tag(
@@ -17,7 +15,7 @@
17
15
  $(function() {
18
16
  $('#resource_filter').on('change', function(e) {
19
17
  var $this = $(this);
20
- var url = '<%= resources_path(resource_handler.namespaced_resources_name, merge_params_only(params_to_keep)).html_safe %>';
18
+ var url = '<%= resources_path(resource_handler.namespaced_resources_name, search_filter_params.except(:filter).to_h) %>';
21
19
  if ($this.data('remote') === true) {
22
20
  $.get(url, {filter: $this.val()}, null, 'script');
23
21
  } else {
@@ -7,7 +7,7 @@
7
7
  <% if params[:tagged_with].present? %>
8
8
  <%= link_to(
9
9
  render_icon('delete-small') + Alchemy.t('Remove tag filter'),
10
- url_for(tag_list_params.delete_if { |k, v| k == "tagged_with" }.merge(action: 'index')),
10
+ url_for(search_filter_params.except(:tagged_with)),
11
11
  remote: request.xhr?,
12
12
  class: 'button small with_icon please_wait'
13
13
  ) %>
@@ -2,7 +2,7 @@
2
2
  <%= f.file_field file_attribute,
3
3
  class: 'fileupload fileupload--field', multiple: true,
4
4
  name: "#{f.object_name}[#{file_attribute}]" %>
5
- <%= hidden_field_tag "#{f.object_name}[upload_hash]", Time.current.hash %>
5
+ <%= hidden_field_tag("#{f.object_name}[upload_hash]", Time.current.hash) if object.respond_to?(:upload_hash) %>
6
6
  <%= f.label file_attribute, data: {alchemy_hotkey: 'alt+n'} do %>
7
7
  <div class="button_with_label">
8
8
  <span class="icon_button"><%= render_icon :upload %></span>
@@ -3,7 +3,7 @@
3
3
  content_id: content.id,
4
4
  only: content.settings_value(:only, local_assigns.fetch(:options, {})),
5
5
  except: content.settings_value(:except, local_assigns.fetch(:options, {})),
6
- options: local_assigns.fetch(:options, {}).to_json
6
+ options: local_assigns.fetch(:options, {})
7
7
  ),
8
8
  {
9
9
  title: Alchemy.t(:assign_file),
@@ -35,7 +35,7 @@
35
35
  <%= link_to_dialog '',
36
36
  alchemy.edit_admin_essence_file_path(
37
37
  id: content.essence.id,
38
- options: local_assigns.fetch(:options, {}).to_json
38
+ options: local_assigns.fetch(:options, {})
39
39
  ),
40
40
  {
41
41
  title: Alchemy.t(:edit_file_properties),
@@ -1,6 +1,6 @@
1
1
  <%= content_tag :div, id: content.dom_id, data: {"content-id" => content.id}, class: [
2
2
  "essence_picture_editor",
3
- options[:dragable] ? "dragable_picture" : nil,
3
+ options[:sortable] ? "draggable_picture" : nil,
4
4
  options[:grouped] ? nil : "content_editor"
5
5
  ].compact.join(" ") do %>
6
6
  <% unless options[:grouped] %><%= content_label(content) %><% end %>
@@ -18,7 +18,7 @@
18
18
  <% end %>
19
19
  </span>
20
20
  <%- if content.ingredient -%>
21
- <div class="picture_handle" title="<%= Alchemy.t(:drag_to_sort) if options[:dragable] %>"></div>
21
+ <div class="picture_handle" title="<%= Alchemy.t(:drag_to_sort) if options[:sortable] %>"></div>
22
22
  <%- end -%>
23
23
  <div class="picture_image">
24
24
  <div class="thumbnail_background<%= ' missing' if content.ingredient.nil? %>">
@@ -4,7 +4,7 @@
4
4
  <%= link_to_dialog render_icon('crop'),
5
5
  alchemy.crop_admin_essence_picture_path(
6
6
  content.essence,
7
- options: content.settings.update(options).to_json
7
+ options: content.settings.update(options)
8
8
  ), {
9
9
  size: "1000x615",
10
10
  title: Alchemy.t('Edit Picturemask'),
@@ -20,7 +20,7 @@
20
20
  element_id: content.element,
21
21
  content_id: content.id,
22
22
  swap: true,
23
- options: options.to_json
23
+ options: options
24
24
  ),
25
25
  {
26
26
  title: (content.ingredient ? Alchemy.t(:swap_image) : Alchemy.t(:insert_image)),
@@ -47,7 +47,7 @@
47
47
  alchemy.edit_admin_essence_picture_path(
48
48
  id: content.essence.id,
49
49
  content_id: content.id,
50
- options: options.to_json
50
+ options: options
51
51
  ), {
52
52
  title: Alchemy.t(:edit_image_properties),
53
53
  size: edit_picture_dialog_size(content, options)
@@ -1,8 +1,7 @@
1
1
  <% if pages.present? %>
2
2
  <%= content_tag(
3
3
  'ul',
4
- :class => html_options[:class] || "navigation level_#{pages.first.level - 1}",
5
- :id => html_options[:id]
4
+ html_options.reverse_merge(class: "navigation level_#{pages.first.level - 1}")
6
5
  ) do %>
7
6
  <% pages.each do |page| %>
8
7
  <% position = 'first' if page == pages.first %>
@@ -0,0 +1,65 @@
1
+ {
2
+ "ignored_warnings": [
3
+ {
4
+ "warning_type": "Mass Assignment",
5
+ "warning_code": 70,
6
+ "fingerprint": "1dd8f69d9b1bdd4017212f38098f03d2ecb2db06269fb940090f209eee7570c6",
7
+ "check_name": "MassAssignment",
8
+ "message": "Parameters should be whitelisted for mass assignment",
9
+ "file": "app/controllers/alchemy/admin/resources_controller.rb",
10
+ "line": 128,
11
+ "link": "http://brakemanscanner.org/docs/warning_types/mass_assignment/",
12
+ "code": "params.require(resource_handler.namespaced_resource_name).permit!",
13
+ "render_path": null,
14
+ "location": {
15
+ "type": "method",
16
+ "class": "Alchemy::Admin::ResourcesController",
17
+ "method": "resource_params"
18
+ },
19
+ "user_input": null,
20
+ "confidence": "Medium",
21
+ "note": "Because we actually can't know all attributes each inheriting controller supports, we permit all resource model params. It is adviced that all inheriting controllers implement this method and provide its own set of permitted attributes. As this all happens inside the password protected /admin namespace this can be considered a false positive."
22
+ },
23
+ {
24
+ "warning_type": "Dynamic Render Path",
25
+ "warning_code": 15,
26
+ "fingerprint": "26461414e9f6be7b68dd8c7dda1c69b09c92a8e9997c0ac204e1756cae7f3d68",
27
+ "check_name": "Render",
28
+ "message": "Render path contains parameter value",
29
+ "file": "app/views/alchemy/admin/contents/create.js.erb",
30
+ "line": 1,
31
+ "link": "http://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
32
+ "code": "render(action => \"alchemy/essences/#{Content.create_from_scratch(Element.find(params[:content][:element_id]), content_params).essence_partial_name}_editor\", { :content => Content.create_from_scratch(Element.find(params[:content][:element_id]), content_params), :options => options_from_params.symbolize_keys, :html_options => (params[:html_options] or {}).symbolize_keys })",
33
+ "render_path": [{"type":"controller","class":"Alchemy::Admin::ContentsController","method":"create","line":21,"file":"app/controllers/alchemy/admin/contents_controller.rb"}],
34
+ "location": {
35
+ "type": "template",
36
+ "template": "alchemy/admin/contents/create"
37
+ },
38
+ "user_input": "params[:content][:element_id]",
39
+ "confidence": "Weak",
40
+ "note": "This dynamic render path comes from the Contents essence not from any params or user mutated string. This can safely be ignored."
41
+ },
42
+ {
43
+ "warning_type": "Mass Assignment",
44
+ "warning_code": 70,
45
+ "fingerprint": "4b4dc24a6f5251bc1a6851597dfcee39608a2932eb7f81a4a241c00fca8a3043",
46
+ "check_name": "MassAssignment",
47
+ "message": "Parameters should be whitelisted for mass assignment",
48
+ "file": "app/controllers/alchemy/admin/elements_controller.rb",
49
+ "line": 168,
50
+ "link": "http://brakemanscanner.org/docs/warning_types/mass_assignment/",
51
+ "code": "params.fetch(:contents, {}).permit!",
52
+ "render_path": null,
53
+ "location": {
54
+ "type": "method",
55
+ "class": "Alchemy::Admin::ElementsController",
56
+ "method": "contents_params"
57
+ },
58
+ "user_input": null,
59
+ "confidence": "Medium",
60
+ "note": "`Alchemy::Content` is a polymorphic association of any kind of model extending `Alchemy::Essence`. Since we can't know the attributes of all potential essences we need to permit all attributes. As this all happens inside the password protected /admin namespace this can be considered a false positive."
61
+ }
62
+ ],
63
+ "updated": "2017-08-16 15:07:26 +0200",
64
+ "brakeman_version": "3.7.0"
65
+ }
@@ -5,7 +5,7 @@
5
5
  # In order to upgrade from an old version of Alchemy, you have to run all migrations from
6
6
  # each version you missed up to the version you want to upgrade to, before running this migration.
7
7
  #
8
- class AlchemyTwoPointSix < ActiveRecord::Migration
8
+ class AlchemyTwoPointSix < ActiveRecord::Migration[4.2]
9
9
  def up
10
10
  unless table_exists?('alchemy_attachments')
11
11
  create_table "alchemy_attachments" do |t|
@@ -1,4 +1,4 @@
1
- class RemoveDoNotIndexFromAlchemyEssenceTexts < ActiveRecord::Migration
1
+ class RemoveDoNotIndexFromAlchemyEssenceTexts < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  remove_column :alchemy_essence_texts, :do_not_index
4
4
  end
@@ -1,4 +1,4 @@
1
- class RemoveDoNotIndexFromAlchemyEssenceRichtexts < ActiveRecord::Migration
1
+ class RemoveDoNotIndexFromAlchemyEssenceRichtexts < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  remove_column :alchemy_essence_richtexts, :do_not_index
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddPublishedAtToAlchemyPages < ActiveRecord::Migration
1
+ class AddPublishedAtToAlchemyPages < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :alchemy_pages, :published_at, :timestamp
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddParentElementIdToAlchemyElements < ActiveRecord::Migration
1
+ class AddParentElementIdToAlchemyElements < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :alchemy_elements, :parent_element_id, :integer
4
4
  add_index :alchemy_elements, [:page_id, :parent_element_id]
@@ -1,4 +1,4 @@
1
- class AddLinkTextToAlchemyEssenceFiles < ActiveRecord::Migration
1
+ class AddLinkTextToAlchemyEssenceFiles < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :alchemy_essence_files, :link_text, :string
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddLocaleToAlchemyLanguages < ActiveRecord::Migration
1
+ class AddLocaleToAlchemyLanguages < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :alchemy_languages, :locale, :string
4
4
  execute \
@@ -1,4 +1,4 @@
1
- class AddTimebasedPublishingColumnsToPages < ActiveRecord::Migration
1
+ class AddTimebasedPublishingColumnsToPages < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :alchemy_pages, :public_on, :datetime
4
4
  add_column :alchemy_pages, :public_until, :datetime
@@ -1,4 +1,4 @@
1
- class AddImageFileFormatToAlchemyPictures < ActiveRecord::Migration
1
+ class AddImageFileFormatToAlchemyPictures < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :alchemy_pictures, :image_file_format, :string
4
4
 
@@ -1,4 +1,4 @@
1
- class ChangeAlchemyPagesLockedToLockedAt < ActiveRecord::Migration
1
+ class ChangeAlchemyPagesLockedToLockedAt < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :alchemy_pages, :locked_at, :datetime
4
4
  update <<-SQL.strip_heredoc
@@ -1,4 +1,4 @@
1
- class AddIndexToAlchemyPagesRgt < ActiveRecord::Migration
1
+ class AddIndexToAlchemyPagesRgt < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_index :alchemy_pages, :rgt
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddForeignKeyIndicesAndNullConstraints < ActiveRecord::Migration
1
+ class AddForeignKeyIndicesAndNullConstraints < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  change_column_null :alchemy_cells, :page_id, false, 0
4
4
  change_column_null :alchemy_contents, :element_id, false, 0
@@ -1,4 +1,4 @@
1
- class AddForeignKeys < ActiveRecord::Migration
1
+ class AddForeignKeys < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_foreign_key :alchemy_cells, :alchemy_pages,
4
4
  column: :page_id,
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy::AbilityHelper
2
4
  # Ensures usage of Alchemy's permissions class.
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Admin
3
5
  module Locale
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Provides authentication accessors.
2
4
  #
3
5
  # Alchemy has some defaults for user model name and login logout path names:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module CacheDigests
3
5
  class TemplateTracker
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # encoding: utf-8
2
4
 
3
5
  module Alchemy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module ConfigurationMethods
3
5
  extend ActiveSupport::Concern
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module ControllerActions
3
5
  extend ActiveSupport::Concern
@@ -0,0 +1,3 @@
1
+ module Alchemy
2
+ Deprecation = ActiveSupport::Deprecation.new('5.0', 'Alchemy')
3
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Custom error classes.
2
4
  #
3
5
  module Alchemy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_record'
2
4
 
3
5
  module Alchemy #:nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Filetypes
3
5
  ARCHIVE_FILE_TYPES = ["application/zip", "application/x-rar"]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Forms
3
5
  class Builder < SimpleForm::FormBuilder
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Hints
3
5
  # Returns a hint
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  class << self
3
5
  # Alchemy shortcut translation method
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Logger
3
5
  # Logs a debug message to the Rails standard logger and adds some nicer formatting
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Modules
3
5
  mattr_accessor :alchemy_modules
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # encoding: utf-8
2
4
 
3
5
  module Alchemy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  # = Provides a DSL to define callbacks run in a before filter on pages show action
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module OnPageLayout
3
5
  # Runs OnPageLayout callbacks
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  class PageLayout
3
5
  class << self
@@ -157,7 +159,7 @@ module Alchemy
157
159
  #
158
160
  def read_definitions_file
159
161
  if File.exist?(layouts_file_path)
160
- YAML.safe_load(ERB.new(File.read(layouts_file_path)).result, [Date], [], true) || []
162
+ YAML.safe_load(ERB.new(File.read(layouts_file_path)).result, [Date, Symbol], [], true) || []
161
163
  else
162
164
  raise LoadError, "Could not find page_layouts.yml file! Please run `rails generate alchemy:scaffold`"
163
165
  end