summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorhukl <hukl@eight.intern.artcom.de>2009-02-03 16:47:43 +0100
committerhukl <hukl@eight.intern.artcom.de>2009-02-03 16:47:43 +0100
commit1902c4bf975a5c1decd199a5190b04d08a2e4760 (patch)
tree11a6983e98567f6894abb7c353e39ea30da458bb /app/models
parent91b6089337e59d0c30a0112a5689f476d3c2f013 (diff)
added lots of comments to describe what the
methods are doing. this will get everyone a better start. I hope
Diffstat (limited to 'app/models')
-rw-r--r--app/models/node.rb1
-rw-r--r--app/models/page.rb14
2 files changed, 8 insertions, 7 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index 3564ce4..0aa28b9 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -40,5 +40,6 @@ class Node < ActiveRecord::Base
40 def update_unique_name 40 def update_unique_name
41 path = self.path_to_root[1..-1] 41 path = self.path_to_root[1..-1]
42 self.unique_name = path.join("/") 42 self.unique_name = path.join("/")
43 self.save
43 end 44 end
44end 45end
diff --git a/app/models/page.rb b/app/models/page.rb
index f6c5ef2..d33e11b 100644
--- a/app/models/page.rb
+++ b/app/models/page.rb
@@ -4,13 +4,13 @@ class Page < ActiveRecord::Base
4 4
5 acts_as_taggable 5 acts_as_taggable
6 acts_as_list :column => :revision, :scope => :node_id 6 acts_as_list :column => :revision, :scope => :node_id
7 7
8 # <aggregate 8 # This method is most likely called from the ContentHelper.render_collection
9 # flags="update, pressemitteilung" 9 # method which aggregates pages into a collection, based on parameters it
10 # limit="20" 10 # recieves. This method then calls Page.aggregate with these parameters.
11 # order_by="published_at" 11 # The Page.aggregate method comes with a defaults hash. These options are
12 # order_direction="DESC" 12 # partially or entirely overwritten by the options hash. Afterwards the merged
13 # /> 13 # parameters are used to query the DB for Pages matching these parameters.
14 def self.aggregate options 14 def self.aggregate options
15 15
16 defaults = { 16 defaults = {