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,20 +1,23 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_elements
4
6
  #
5
- # id :integer not null, primary key
6
- # name :string(255)
7
- # position :integer
8
- # page_id :integer
9
- # public :boolean default(TRUE)
10
- # folded :boolean default(FALSE)
11
- # unique :boolean default(FALSE)
12
- # created_at :datetime not null
13
- # updated_at :datetime not null
14
- # creator_id :integer
15
- # updater_id :integer
16
- # cell_id :integer
17
- # cached_tag_list :text
7
+ # id :integer not null, primary key
8
+ # name :string
9
+ # position :integer
10
+ # page_id :integer not null
11
+ # public :boolean default(TRUE)
12
+ # folded :boolean default(FALSE)
13
+ # unique :boolean default(FALSE)
14
+ # created_at :datetime not null
15
+ # updated_at :datetime not null
16
+ # creator_id :integer
17
+ # updater_id :integer
18
+ # cell_id :integer
19
+ # cached_tag_list :text
20
+ # parent_element_id :integer
18
21
  #
19
22
 
20
23
  module Alchemy
@@ -77,7 +80,7 @@ module Alchemy
77
80
  required: false,
78
81
  touch: true
79
82
 
80
- has_and_belongs_to_many :touchable_pages, -> { uniq },
83
+ has_and_belongs_to_many :touchable_pages, -> { distinct },
81
84
  class_name: 'Alchemy::Page',
82
85
  join_table: ElementToPage.table_name
83
86
 
@@ -121,9 +124,7 @@ module Alchemy
121
124
  # could be found
122
125
  #
123
126
  def new_from_scratch(attributes = {})
124
- attributes = attributes.dup.symbolize_keys
125
127
  return new if attributes[:name].blank?
126
-
127
128
  new_element_from_definition_by(attributes) || raise(ElementDefinitionError, attributes)
128
129
  end
129
130
 
@@ -152,10 +153,7 @@ module Alchemy
152
153
  # @copy.public? # => false
153
154
  #
154
155
  def copy(source_element, differences = {})
155
- source_element.attributes.stringify_keys!
156
- differences.stringify_keys!
157
-
158
- attributes = source_element.attributes
156
+ attributes = source_element.attributes.with_indifferent_access
159
157
  .except(*SKIPPED_ATTRIBUTES_ON_COPY)
160
158
  .merge(differences)
161
159
  .merge({
@@ -193,16 +191,11 @@ module Alchemy
193
191
  private
194
192
 
195
193
  def new_element_from_definition_by(attributes)
196
- remove_cell_name_from_element_name!(attributes)
197
-
198
- element_definition = Element.definition_by_name(attributes[:name])
194
+ element_attributes = attributes.to_h.merge(name: attributes[:name].split('#').first)
195
+ element_definition = Element.definition_by_name(element_attributes[:name])
199
196
  return if element_definition.nil?
200
197
 
201
- new(element_definition.merge(attributes).except(*FORBIDDEN_DEFINITION_ATTRIBUTES))
202
- end
203
-
204
- def remove_cell_name_from_element_name!(attributes)
205
- attributes[:name] = attributes[:name].split('#').first
198
+ new(element_definition.merge(element_attributes).except(*FORBIDDEN_DEFINITION_ATTRIBUTES))
206
199
  end
207
200
  end
208
201
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  # Module concerning element definitions
3
5
  #
@@ -11,7 +13,7 @@ module Alchemy
11
13
  # your own set of elements
12
14
  #
13
15
  def definitions
14
- @definitions ||= read_definitions_file
16
+ @definitions ||= read_definitions_file.map(&:with_indifferent_access)
15
17
  end
16
18
 
17
19
  # Returns one element definition by given name.
@@ -26,7 +28,7 @@ module Alchemy
26
28
  #
27
29
  def read_definitions_file
28
30
  if ::File.exist?(definitions_file_path)
29
- ::YAML.safe_load(ERB.new(File.read(definitions_file_path)).result, [Regexp, Date], [], true) || []
31
+ ::YAML.safe_load(ERB.new(File.read(definitions_file_path)).result, [Date, Regexp, Symbol], [], true) || []
30
32
  else
31
33
  raise LoadError, "Could not find elements.yml file! Please run `rails generate alchemy:scaffold`"
32
34
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Methods concerning contents for elements
2
4
  #
3
5
  module Alchemy
@@ -138,7 +140,7 @@ module Alchemy
138
140
  # creates the contents for this element as described in the elements.yml
139
141
  def create_contents
140
142
  definition.fetch("contents", []).each do |content_hash|
141
- Content.create_from_scratch(self, content_hash.symbolize_keys)
143
+ Content.create_from_scratch(self, content_hash)
142
144
  end
143
145
  end
144
146
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Element::ElementEssences
3
5
  # Returns the contents essence value (aka. ingredient) for passed content name.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  # Methods used for presenting an Alchemy Element.
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  class ElementToPage
3
5
  def self.table_name
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_essence_booleans
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_essence_dates
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_essence_files
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_essence_htmls
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_essence_links
4
6
  #
5
7
  # id :integer not null, primary key
6
- # link :string(255)
7
- # link_title :string(255)
8
- # link_target :string(255)
9
- # link_class_name :string(255)
8
+ # link :string
9
+ # link_title :string
10
+ # link_target :string
11
+ # link_class_name :string
10
12
  # created_at :datetime not null
11
13
  # updated_at :datetime not null
12
14
  # creator_id :integer
@@ -1,24 +1,26 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_essence_pictures
4
6
  #
5
7
  # id :integer not null, primary key
6
8
  # picture_id :integer
7
- # caption :string(255)
8
- # title :string(255)
9
- # alt_tag :string(255)
10
- # link :string(255)
11
- # link_class_name :string(255)
12
- # link_title :string(255)
13
- # css_class :string(255)
14
- # link_target :string(255)
9
+ # caption :string
10
+ # title :string
11
+ # alt_tag :string
12
+ # link :string
13
+ # link_class_name :string
14
+ # link_title :string
15
+ # css_class :string
16
+ # link_target :string
15
17
  # creator_id :integer
16
18
  # updater_id :integer
17
19
  # created_at :datetime not null
18
20
  # updated_at :datetime not null
19
- # crop_from :string(255)
20
- # crop_size :string(255)
21
- # render_size :string(255)
21
+ # crop_from :string
22
+ # crop_size :string
23
+ # render_size :string
22
24
  #
23
25
 
24
26
  module Alchemy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  # Renders an essence picture view
3
5
  class EssencePictureView
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_essence_richtexts
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_essence_selects
4
6
  #
5
7
  # id :integer not null, primary key
6
- # value :string(255)
8
+ # value :string
7
9
  # created_at :datetime not null
8
10
  # updated_at :datetime not null
9
11
  # creator_id :integer
@@ -1,14 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_essence_texts
4
6
  #
5
7
  # id :integer not null, primary key
6
8
  # body :text
7
- # link :string(255)
8
- # link_title :string(255)
9
- # link_class_name :string(255)
9
+ # link :string
10
+ # link_title :string
11
+ # link_class_name :string
10
12
  # public :boolean default(FALSE)
11
- # link_target :string(255)
13
+ # link_target :string
12
14
  # creator_id :integer
13
15
  # updater_id :integer
14
16
  # created_at :datetime not null
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_folded_pages
4
6
  #
5
7
  # id :integer not null, primary key
6
- # page_id :integer
7
- # user_id :integer
8
+ # page_id :integer not null
9
+ # user_id :integer not null
8
10
  # folded :boolean default(FALSE)
9
11
  #
10
12
 
@@ -1,20 +1,23 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_languages
4
6
  #
5
7
  # id :integer not null, primary key
6
- # name :string(255)
7
- # language_code :string(255)
8
- # frontpage_name :string(255)
9
- # page_layout :string(255) default("intro")
8
+ # name :string
9
+ # language_code :string
10
+ # frontpage_name :string
11
+ # page_layout :string default("intro")
10
12
  # public :boolean default(FALSE)
11
13
  # created_at :datetime not null
12
14
  # updated_at :datetime not null
13
15
  # creator_id :integer
14
16
  # updater_id :integer
15
17
  # default :boolean default(FALSE)
16
- # country_code :string(255) default(""), not null
17
- # site_id :integer
18
+ # country_code :string default(""), not null
19
+ # site_id :integer not null
20
+ # locale :string
18
21
  #
19
22
 
20
23
  module Alchemy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy::Language::Code
2
4
  extend ActiveSupport::Concern
3
5
 
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_legacy_page_urls
4
6
  #
5
7
  # id :integer not null, primary key
6
- # urlname :string(255) not null
8
+ # urlname :string not null
7
9
  # page_id :integer not null
8
10
  # created_at :datetime not null
9
11
  # updated_at :datetime not null
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This is a tableless model used for contact forms.
2
4
  #
3
5
  # You can specify the fields for your contact form in
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_pages
@@ -16,8 +18,6 @@
16
18
  # parent_id :integer
17
19
  # depth :integer
18
20
  # visible :boolean default(FALSE)
19
- # public :boolean default(FALSE)
20
- # locked_at :datetime
21
21
  # locked_by :integer
22
22
  # restricted :boolean default(FALSE)
23
23
  # robot_index :boolean default(TRUE)
@@ -33,6 +33,7 @@
33
33
  # published_at :datetime
34
34
  # public_on :datetime
35
35
  # public_until :datetime
36
+ # locked_at :datetime
36
37
  #
37
38
 
38
39
  module Alchemy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  # = Fixed page attributes
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Page::PageCells
3
5
  extend ActiveSupport::Concern
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Page::PageElements
3
5
  extend ActiveSupport::Concern
@@ -17,7 +19,7 @@ module Alchemy
17
19
  through: :descendent_elements,
18
20
  class_name: 'Alchemy::Content',
19
21
  source: :contents
20
- has_and_belongs_to_many :to_be_swept_elements, -> { uniq },
22
+ has_and_belongs_to_many :to_be_swept_elements, -> { distinct },
21
23
  class_name: 'Alchemy::Element',
22
24
  join_table: ElementToPage.table_name
23
25
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Page::PageNaming
3
5
  extend ActiveSupport::Concern
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Page::PageNatures
3
5
  extend ActiveSupport::Concern
@@ -96,7 +98,6 @@ module Alchemy
96
98
 
97
99
  # Returns the self#page_layout definition from config/alchemy/page_layouts.yml file.
98
100
  def definition
99
- return {} if systempage?
100
101
  definition = PageLayout.get(page_layout)
101
102
  if definition.nil?
102
103
  log_warning "Page definition for `#{page_layout}` not found. Please check `page_layouts.yml` file."
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  # ActiveRecord scopes for Alchemy::Page
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Alchemy
2
4
  module Page::PageUsers
3
5
  extend ActiveSupport::Concern
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # == Schema Information
2
4
  #
3
5
  # Table name: alchemy_pictures