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 odd timezone bug when saving articles

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1978 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Fri Sep 01 19:38:00 -0700 2006
commit  2747e838c2281ee6423647ea10b8548dc02f3e0d
tree    0d1fc6d782bd514767e8123627403f56c7264661
parent  414967ba196095c4d4214f349ae9ee758c17f268
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 * SVN *
0
 
0
+* fix odd timezone bug when saving articles
0
+
0
 * fix bug with <typo:code> macro
0
 
0
 * bad feed urls raise ActiveRecord::RecordNotFound, and return 404 in production
...
137
138
139
140
 
141
142
143
...
137
138
139
 
140
141
142
143
0
@@ -137,7 +137,7 @@ class Admin::ArticlesController < Admin::BaseController
0
         date = Time.parse_from_attributes(params[:article], :published_at, :local)
0
         next unless date
0
         params[:article].delete_if { |k, v| k.to_s =~ /^#{:published_at}/ }
0
- params[:article][:published_at] = date.utc
0
+ params[:article][:published_at] = utc_to_local(date)
0
       end
0
     end
0
     
...
90
91
92
93
 
94
95
96
...
181
182
183
184
 
185
186
187
...
330
331
332
333
 
334
335
336
...
90
91
92
 
93
94
95
96
...
181
182
183
 
184
185
186
187
...
330
331
332
 
333
334
335
336
0
@@ -90,7 +90,7 @@ class Admin::ArticlesControllerTest < Test::Unit::TestCase
0
           'published_at(1i)' => '2005', 'published_at(2i)' => '1', 'published_at(3i)' => '1', 'published_at(4i)' => '10' }, :submit => :save
0
         assert_redirected_to :action => 'index'
0
         assert assigns(:article).published?
0
- assert_equal Time.local(2005, 1, 1, 9, 0, 0).utc, assigns(:article).published_at
0
+ assert_equal Time.utc(2005, 1, 1, 5, 0, 0), assigns(:article).published_at
0
         assert !assigns(:article).new_record?
0
         assert_equal users(:quentin), assigns(:article).updater
0
       end
0
@@ -181,7 +181,7 @@ class Admin::ArticlesControllerTest < Test::Unit::TestCase
0
       post :update, :id => contents(:welcome).id, :article => { 'published_at(1i)' => '2005', 'published_at(2i)' => '1', 'published_at(3i)' => '1', 'published_at(4i)' => '10' }
0
       assert_redirected_to :action => 'index'
0
       assert assigns(:article).published?
0
- assert_equal Time.local(2005, 1, 1, 9, 0, 0).utc, assigns(:article).published_at
0
+ assert_equal Time.utc(2005, 1, 1, 5, 0, 0), assigns(:article).published_at
0
     end
0
   end
0
 
0
@@ -330,7 +330,7 @@ class Admin::ArticlesControllerTest < Test::Unit::TestCase
0
         assert_template 'new'
0
         assert_valid assigns(:article)
0
         assert assigns(:article).new_record?
0
- assert_equal Time.local(2005, 1, 1, 9, 0, 0).utc, assigns(:article).published_at
0
+ assert_equal Time.utc(2005, 1, 1, 5, 0, 0), assigns(:article).published_at
0
         assert_equal users(:quentin), assigns(:article).updater
0
       end
0
     end

Comments

    No one has commented yet.