smaller fixes for journalized news and attachments

This commit is contained in:
Tim Felgentreff 2010-08-06 18:47:56 +02:00
parent cbfbd662bb
commit 7d67365e10
2 changed files with 1 additions and 4 deletions

View File

@ -23,7 +23,6 @@ class Attachment < ActiveRecord::Base
# FIXME: Remove these once the Versions, Documents and Projects themselves can provide file events # FIXME: Remove these once the Versions, Documents and Projects themselves can provide file events
belongs_to :version, :foreign_key => "container_id" belongs_to :version, :foreign_key => "container_id"
belongs_to :document, :foreign_key => "container_id" belongs_to :document, :foreign_key => "container_id"
belongs_to :project, :foreign_key => "container_id"
belongs_to :author, :class_name => "User", :foreign_key => "author_id" belongs_to :author, :class_name => "User", :foreign_key => "author_id"
@ -53,8 +52,6 @@ class Attachment < ActiveRecord::Base
"documents" "documents"
when "Version" when "Version"
"files" "files"
when "Project"
"files"
else else
super super
end end

View File

@ -24,7 +24,7 @@ class News < ActiveRecord::Base
validates_length_of :title, :maximum => 60 validates_length_of :title, :maximum => 60
validates_length_of :summary, :maximum => 255 validates_length_of :summary, :maximum => 255
acts_as_journalized :event_url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.id} } acts_as_journalized :event_url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.versioned_id} }
acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"], :include => :project acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"], :include => :project
def visible?(user=User.current) def visible?(user=User.current)