Delete page.
This commit is contained in:
1 parent
ddc7c74436
commit
7b5ea870a0
8 files changed
+41
-10
No files matched your search
@@ -37,11 +37,6 @@ class Item
|
||||
nodes.reverse
|
||||
end
|
||||
|
||||
# Destroy the i18n_variable
|
||||
def destroy_i18n_variable
|
||||
self.i18n_variable.destroy rescue nil
|
||||
end
|
||||
|
||||
# Update or create the i18n_variable record
|
||||
def i18n_variable=(attr)
|
||||
if self.i18n_variable_id
|
||||
|
||||
@@ -18,6 +18,14 @@ class Page < Item
|
||||
end
|
||||
end
|
||||
|
||||
# Destroy the page_parts
|
||||
def destroy_page_parts
|
||||
self.page_parts.each do |part|
|
||||
part.destroy_i18n_variable
|
||||
part.destroy
|
||||
end
|
||||
end
|
||||
|
||||
def get_layout
|
||||
Layout.find(layout_id)
|
||||
end
|
||||
|
||||
@@ -26,6 +26,10 @@ class PagePart
|
||||
end
|
||||
end
|
||||
|
||||
def destroy_i18n_variable
|
||||
self.i18n_variable.destroy rescue nil
|
||||
end
|
||||
|
||||
# Build the content from the i18n_variable
|
||||
def build_content(locales)
|
||||
res = ''
|
||||
|
||||
Reference in new issue
Block a user