app/models/alchemy/page.rb in alchemy_cms-7.0.0.pre.a vs app/models/alchemy/page.rb in alchemy_cms-7.0.0.pre.b
- old
+ new
@@ -51,25 +51,25 @@
DEFAULT_ATTRIBUTES_FOR_COPY = {
autogenerate_elements: false,
public_on: nil,
public_until: nil,
locked_at: nil,
- locked_by: nil,
+ locked_by: nil
}
- SKIPPED_ATTRIBUTES_ON_COPY = %w(
+ SKIPPED_ATTRIBUTES_ON_COPY = %w[
id
updated_at
created_at
creator_id
updater_id
lft
rgt
depth
urlname
cached_tag_list
- )
+ ]
PERMITTED_ATTRIBUTES = [
:meta_description,
:meta_keywords,
:name,
@@ -83,11 +83,11 @@
:sitemap,
:tag_list,
:title,
:urlname,
:layoutpage,
- :menu_id,
+ :menu_id
]
acts_as_nested_set(dependent: :destroy, scope: [:layoutpage, :language_id])
stampable stamper_class_name: Alchemy.user_class.name
@@ -183,16 +183,16 @@
def alchemy_resource_filters
[
{
name: :by_page_layout,
- values: PageLayout.all.map { |p| [Alchemy.t(p["name"], scope: "page_layout_names"), p["name"]] },
+ values: PageLayout.all.map { |p| [Alchemy.t(p["name"], scope: "page_layout_names"), p["name"]] }
},
{
name: :status,
- values: %w[published not_public restricted],
- },
+ values: %w[published not_public restricted]
+ }
]
end
def searchable_alchemy_resource_attributes
%w[name urlname title]
@@ -246,11 +246,11 @@
def copy_and_paste(source, new_parent, new_name)
page = copy(source, {
parent: new_parent,
language: new_parent&.language,
name: new_name,
- title: new_name,
+ title: new_name
})
if source.children.any?
source.copy_children_to(page)
end
page
@@ -274,11 +274,11 @@
def link_target_options
options = [[Alchemy.t(:default, scope: "link_target_options"), ""]]
link_target_options = Config.get(:link_target_options)
link_target_options.each do |option|
options << [Alchemy.t(option, scope: "link_target_options",
- default: option.to_s.humanize), option]
+ default: option.to_s.humanize), option]
end
options
end
private
@@ -448,11 +448,11 @@
next if child == new_parent
new_child = Page.copy(child, {
parent_id: new_parent.id,
language_id: new_parent.language_id,
- language_code: new_parent.language_code,
+ language_code: new_parent.language_code
})
new_child.move_to_child_of(new_parent)
child.copy_children_to(new_child) unless child.children.blank?
end
end
@@ -489,10 +489,10 @@
#
# @param [TreeNode]
# A tree node with new lft, rgt, depth, url, parent_id and restricted indexes to be updated
#
def update_node!(node)
- hash = { lft: node.left, rgt: node.right, parent_id: node.parent, depth: node.depth, restricted: node.restricted }
+ hash = {lft: node.left, rgt: node.right, parent_id: node.parent, depth: node.depth, restricted: node.restricted}
if urlname != node.url
LegacyPageUrl.create(page_id: id, urlname: urlname)
hash[:urlname] = node.url
end