smaller fixes for journalized news and attachments
This commit is contained in:
parent
cbfbd662bb
commit
7d67365e10
@ -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
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user