diff options
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/node.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/node.rb b/app/models/node.rb index 19669ca..b5b18a1 100644 --- a/app/models/node.rb +++ b/app/models/node.rb | |||
| @@ -75,7 +75,11 @@ class Node < ApplicationRecord | |||
| 75 | # exist for that. | 75 | # exist for that. |
| 76 | def self.trash | 76 | def self.trash |
| 77 | root.children.find_by(:slug => CccConventions::TRASH_SLUG) || | 77 | root.children.find_by(:slug => CccConventions::TRASH_SLUG) || |
| 78 | root.children.create!(:slug => CccConventions::TRASH_SLUG) | 78 | root.children.create!(:slug => CccConventions::TRASH_SLUG).tap do |node| |
| 79 | Globalize.with_locale(I18n.default_locale) do | ||
| 80 | node.draft.update!(:title => "Trash") | ||
| 81 | end | ||
| 82 | end | ||
| 79 | end | 83 | end |
| 80 | 84 | ||
| 81 | # Instance Methods | 85 | # Instance Methods |
