Fully leverage the #wiki_files association on Web
This commit is contained in:
parent
8c1ded2303
commit
bea8525130
1 changed files with 3 additions and 3 deletions
|
@ -77,11 +77,11 @@ class Web < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_file?(file_name)
|
def has_file?(file_name)
|
||||||
WikiFile.find_by_file_name(file_name) != nil
|
wiki_files.exists?(:file_name => file_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def file_list(sort_order = 'file_name')
|
def file_list(sort_order="file_name")
|
||||||
WikiFile.all(:order => sort_order, :conditions => ['web_id = ?', id])
|
wiki_files.all(:order => sort_order)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pages_that_link_to(page_name)
|
def pages_that_link_to(page_name)
|
||||||
|
|
Loading…
Reference in a new issue