Commit 7d67365e authored by Tim Felgentreff's avatar Tim Felgentreff

smaller fixes for journalized news and attachments

parent cbfbd662
......@@ -23,7 +23,6 @@ class Attachment < ActiveRecord::Base
# FIXME: Remove these once the Versions, Documents and Projects themselves can provide file events
belongs_to :version, :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"
......@@ -53,8 +52,6 @@ class Attachment < ActiveRecord::Base
"documents"
when "Version"
"files"
when "Project"
"files"
else
super
end
......
......@@ -24,7 +24,7 @@ class News < ActiveRecord::Base
validates_length_of :title, :maximum => 60
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
def visible?(user=User.current)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment