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 !
make site creation more robust

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1320 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sat Jul 08 18:46:07 -0700 2006
commit  0cf9817f86f6659373017d3ba68a8d7afbb5db2e
tree    4e2e371327fb94f97f0fe08e1a8bf8260f0ebf59
parent  29cabac5c498be59cc077a2a39b3bbd292d178d9
...
16
17
18
19
 
 
20
21
22
...
45
46
47
48
 
 
 
 
 
 
49
50
51
52
53
54
55
...
16
17
18
 
19
20
21
22
23
...
46
47
48
 
49
50
51
52
53
54
55
56
57
 
58
59
60
0
@@ -16,7 +16,8 @@ class Site < ActiveRecord::Base
0
   
0
   serialize :filters, Array
0
   
0
- before_validation_on_create :set_default_options
0
+ before_validation :set_default_timezone
0
+ before_validation_on_create :set_default_comment_options
0
   validates_uniqueness_of :host
0
 
0
   with_options :order => 'contents.created_at', :class_name => 'Comment' do |comment|
0
@@ -45,11 +46,15 @@ class Site < ActiveRecord::Base
0
   end
0
 
0
   protected
0
- def set_default_options
0
+ def set_default_timezone
0
+ self.timezone = 'UTC' if read_attribute(:timezone).blank?
0
+ true
0
+ end
0
+
0
+ def set_default_comment_options
0
       self.accept_comments = true unless accept_comments == false
0
       self.approve_comments = false unless approve_comments?
0
       self.comment_age = 30 unless comment_age
0
- self.timezone = 'UTC' if timezone.blank?
0
       true
0
     end
0
 end

Comments

    No one has commented yet.