public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
fix issues with published_at_for helper and unpublished articles

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1435 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Wed Jul 26 22:24:51 -0700 2006
commit  f40c22aa512262edcab0a6f0182103494e87146c
tree    1ce543d00506e8ce9e10c7dd4bb37b68693ea9c2
parent  dec8a2baab3390db0bdab50cfb3ba2899e48eb2e
...
15
16
17
18
19
20
 
 
21
22
23
...
15
16
17
 
 
 
18
19
20
21
22
0
@@ -15,9 +15,8 @@ module Admin::ArticlesHelper
0
   end
0
 
0
   def published_at_for(article)
0
- return 'not published' unless article
0
- format = article.published_at.year == Time.now.utc.year ? :plain : :standard
0
- article.published? ? utc_to_local(article.published_at).to_s(format) : "not published"
0
+ return 'not published' unless article && article.published?
0
+ utc_to_local(article.published_at).to_s(article.published_at.year == Time.now.utc.year ? :plain : :standard)
0
   end
0
 
0
   def valid_filter?(filter = params[:filter])
...
13
14
15
16
 
17
18
19
20
 
 
 
21
22
23
...
13
14
15
 
16
17
 
 
 
18
19
20
21
22
23
0
@@ -13,11 +13,11 @@ class Article < Content
0
     end
0
   end
0
 
0
- has_many :assigned_sections
0
+ has_many :assigned_sections, :dependent => :delete_all
0
   has_many :sections, :through => :assigned_sections, :order => 'sections.name'
0
- has_many :events, :order => 'created_at desc'
0
- with_options :order => 'created_at',:class_name => 'Comment' do |comment|
0
- comment.has_many :comments, :conditions => ['contents.approved = ?', true] do
0
+ has_many :events, :order => 'created_at desc', :dependent => :delete_all
0
+ with_options :order => 'created_at', :class_name => 'Comment' do |comment|
0
+ comment.has_many :comments, :conditions => ['contents.approved = ?', true], :dependent => :delete_all do
0
       def unapprove(id)
0
         returning find(id) do |comment|
0
           comment.approved = false

Comments

    No one has commented yet.