diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-12-10 13:34:23 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-12-10 13:34:23 +0000 |
commit | ae22cb7fca2657de6372b3c125593f1a3f2e998c (patch) | |
tree | aa2f9fc160eeefaa2508ab168ec18764f0b96f1a /app/models/wiki_page.rb | |
parent | 027af9e7b5ff34fdf7fef0060169062f82952462 (diff) | |
download | redmine-ae22cb7fca2657de6372b3c125593f1a3f2e998c.tar.gz redmine-ae22cb7fca2657de6372b3c125593f1a3f2e998c.zip |
shorten long line of app/models/wiki_page.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20612 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r-- | app/models/wiki_page.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 7011bdf97..fe0419fdd 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -23,18 +23,25 @@ class WikiPage < ActiveRecord::Base include Redmine::SafeAttributes belongs_to :wiki - has_one :content, :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' + has_one :content, :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_tree :dependent => :nullify, :order => 'title' acts_as_watchable - acts_as_event :title => Proc.new {|o| "#{l(:label_wiki)}: #{o.title}"}, - :description => :text, - :datetime => :created_on, - :url => Proc.new {|o| {:controller => 'wiki', :action => 'show', :project_id => o.wiki.project, :id => o.title}} - + acts_as_event( + :title => proc {|o| "#{l(:label_wiki)}: #{o.title}"}, + :description => :text, + :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"], :scope => joins(:content, {:wiki => :project}), :preload => [:content, {:wiki => :project}], |