Remove unused function from Page model
This commit is contained in:
parent
db46f189be
commit
cef951e421
1 changed files with 2 additions and 7 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue