summaryrefslogtreecommitdiff
path: root/app/models/page.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/page.rb')
-rw-r--r--app/models/page.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/models/page.rb b/app/models/page.rb
index 0cfad53a..f804353a 100644
--- a/app/models/page.rb
+++ b/app/models/page.rb
@@ -64,7 +64,7 @@ class Page < ActiveRecord::Base
64 64
65 Page.heads.paginate( 65 Page.heads.paginate(
66 find_options_for_find_tagged_with( 66 find_options_for_find_tagged_with(
67 options[:tags].gsub(/\s/, ","), :match_all => true 67 options[:tags].gsub(/\s/, ","), :match_all => true, :conditions => options[:conditions]
68 ).merge( 68 ).merge(
69 :page => page, 69 :page => page,
70 :per_page => options[:limit], 70 :per_page => options[:limit],
@@ -94,6 +94,19 @@ class Page < ActiveRecord::Base
94 end 94 end
95 end 95 end
96 96
97 # Is used to compare a node's head with the node's draft
98
99 def has_changes_to? draft
100 return true unless node == draft.node
101 return true unless assets == draft.assets
102 return true unless tag_list == draft.tag_list
103 return true unless template_name == draft.template_name
104 return true unless translated_locales.sort_by(&:to_s) == draft.translated_locales.sort_by(&:to_s)
105 changed = false
106 translated_locales.each { |locale| I18n.with_locale(locale) { changed = true unless title == draft.title && abstract == draft.abstract && body == draft.body } }
107 return changed
108 end
109
97 # Instance Methods 110 # Instance Methods
98 111
99 def public_template_path 112 def public_template_path