Remove unused function from Page model

This commit is contained in:
Patrick Gansterer 2017-10-20 12:08:52 +02:00
parent db46f189be
commit cef951e421

View file

@ -28,10 +28,6 @@ class Page < ActiveRecord::Base
permalink == "Home" permalink == "Home"
end end
def public_front_page?
permalink == "Public_frontpage"
end
def self.public_front_page def self.public_front_page
where(permalink: "Public_frontpage").first where(permalink: "Public_frontpage").first
end end
@ -41,11 +37,11 @@ class Page < ActiveRecord::Base
self.permalink = Page.count == 0 ? "Home" : Page.permalink(title) self.permalink = Page.count == 0 ? "Home" : Page.permalink(title)
end end
end end
def diff def diff
current = versions.latest current = versions.latest
old = versions.where(["page_id = ? and lock_version < ?", current.page_id, current.lock_version]).order('lock_version DESC').first old = versions.where(["page_id = ? and lock_version < ?", current.page_id, current.lock_version]).order('lock_version DESC').first
if old if old
o = '' o = ''
Diffy::Diff.new(old.body, current.body).each do |line| Diffy::Diff.new(old.body, current.body).each do |line|
@ -79,4 +75,3 @@ class Page < ActiveRecord::Base
end end
end end
end end