diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 502e529c..da1fd1c2 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -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 diff --git a/app/models/news.rb b/app/models/news.rb index 91700ebf..46769876 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -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)