Document many obvious methods on Web
This commit is contained in:
parent
33bbf31333
commit
5a29810abc
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,7 @@ class Web < ActiveRecord::Base
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
|
# @return [Wiki] a new Wiki instance
|
||||||
def wiki
|
def wiki
|
||||||
Wiki.new
|
Wiki.new
|
||||||
end
|
end
|
||||||
|
@ -119,6 +120,7 @@ class Web < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# OPTIMIZE Use the +delete_all+ with conditions for extra efficiency
|
||||||
def remove_pages(pages_to_be_removed)
|
def remove_pages(pages_to_be_removed)
|
||||||
pages_to_be_removed.each { |p| p.destroy }
|
pages_to_be_removed.each { |p| p.destroy }
|
||||||
end
|
end
|
||||||
|
@ -135,6 +137,7 @@ class Web < ActiveRecord::Base
|
||||||
PageSet.new(self, pages, nil)
|
PageSet.new(self, pages, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @return [String] uses the +address+ attribute for this record's parameter name
|
||||||
def to_param
|
def to_param
|
||||||
address
|
address
|
||||||
end
|
end
|
||||||
|
@ -166,6 +169,7 @@ class Web < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @return [Pathname] the path to the files for this record
|
||||||
def files_path
|
def files_path
|
||||||
path = Rails.root.join("webs")
|
path = Rails.root.join("webs")
|
||||||
if default_web?
|
if default_web?
|
||||||
|
@ -175,6 +179,7 @@ class Web < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @return [Pathname] the path to PNGs for this record
|
||||||
def blahtex_pngs_path
|
def blahtex_pngs_path
|
||||||
files_path.join("pngs")
|
files_path.join("pngs")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue