mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
shorten long line of app/models/wiki_page.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20612 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
027af9e7b5
commit
ae22cb7fca
@ -23,18 +23,25 @@ class WikiPage < ActiveRecord::Base
|
|||||||
include Redmine::SafeAttributes
|
include Redmine::SafeAttributes
|
||||||
|
|
||||||
belongs_to :wiki
|
belongs_to :wiki
|
||||||
has_one :content, :class_name => 'WikiContent', :foreign_key => 'page_id', :dependent => :destroy
|
has_one :content, :class_name => 'WikiContent', :foreign_key => 'page_id',
|
||||||
has_one :content_without_text, lambda {without_text.readonly}, :class_name => 'WikiContent', :foreign_key => 'page_id'
|
:dependent => :destroy
|
||||||
|
has_one :content_without_text, lambda {without_text.readonly},
|
||||||
|
:class_name => 'WikiContent', :foreign_key => 'page_id'
|
||||||
|
|
||||||
acts_as_attachable :delete_permission => :delete_wiki_pages_attachments
|
acts_as_attachable :delete_permission => :delete_wiki_pages_attachments
|
||||||
acts_as_tree :dependent => :nullify, :order => 'title'
|
acts_as_tree :dependent => :nullify, :order => 'title'
|
||||||
|
|
||||||
acts_as_watchable
|
acts_as_watchable
|
||||||
acts_as_event :title => Proc.new {|o| "#{l(:label_wiki)}: #{o.title}"},
|
acts_as_event(
|
||||||
:description => :text,
|
:title => proc {|o| "#{l(:label_wiki)}: #{o.title}"},
|
||||||
:datetime => :created_on,
|
:description => :text,
|
||||||
:url => Proc.new {|o| {:controller => 'wiki', :action => 'show', :project_id => o.wiki.project, :id => o.title}}
|
:datetime => :created_on,
|
||||||
|
:url =>
|
||||||
|
proc do |o|
|
||||||
|
{:controller => 'wiki', :action => 'show',
|
||||||
|
:project_id => o.wiki.project, :id => o.title}
|
||||||
|
end
|
||||||
|
)
|
||||||
acts_as_searchable :columns => ['title', "#{WikiContent.table_name}.text"],
|
acts_as_searchable :columns => ['title', "#{WikiContent.table_name}.text"],
|
||||||
:scope => joins(:content, {:wiki => :project}),
|
:scope => joins(:content, {:wiki => :project}),
|
||||||
:preload => [:content, {:wiki => :project}],
|
:preload => [:content, {:wiki => :project}],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user