summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/node.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index a440c2f..746b7c7 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -443,7 +443,7 @@ class Node < ApplicationRecord
443 end 443 end
444 444
445 def title 445 def title
446 head ? head.title : draft.title 446 editable_page&.title
447 end 447 end
448 448
449 def update_unique_names? 449 def update_unique_names?
@@ -533,13 +533,6 @@ class Node < ApplicationRecord
533 throw :abort 533 throw :abort
534 end 534 end
535 535
536 def self.recently_changed
537 includes(:head).where(
538 "pages.updated_at < ? AND pages.updated_at > ? AND nodes.parent_id IS NOT NULL",
539 Time.now, Time.now - 14.days
540 ).order("pages.updated_at desc").references(:head)
541 end
542
543 protected 536 protected
544 def lock_for! current_user 537 def lock_for! current_user
545 self.lock_owner = current_user 538 self.lock_owner = current_user