Skip to content

Commit

Permalink
Remove LOCAL_DATETIME_OFFSET_SECS and LOCAL_DATETIME_OFFSET constants
Browse files Browse the repository at this point in the history
Also, mark a spec as pending when using the do adapter (except on
SQLite).
  • Loading branch information
jeremyevans committed Jul 27, 2010
1 parent 59d4b97 commit 81f2dd2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions lib/sequel/timezones.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
module Sequel
# The offset of the current time zone from UTC, in seconds.
LOCAL_DATETIME_OFFSET_SECS = Time.now.utc_offset

# The offset of the current time zone from UTC, as a fraction of a day.
LOCAL_DATETIME_OFFSET = respond_to?(:Rational, true) ? Rational(LOCAL_DATETIME_OFFSET_SECS, 60*60*24) : LOCAL_DATETIME_OFFSET_SECS/60/60/24.0

@application_timezone = nil
@database_timezone = nil
@typecast_timezone = nil
Expand Down
2 changes: 1 addition & 1 deletion spec/core/dataset_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3631,7 +3631,7 @@ def @ds.fetch_rows(sql, &block)
@dataset.literal(t).should == "#{s}#{@offset}'"

t = DateTime.now.new_offset(0)
s = t.new_offset(Sequel::LOCAL_DATETIME_OFFSET).strftime("'%Y-%m-%d %H:%M:%S")
s = t.new_offset(DateTime.now.offset).strftime("'%Y-%m-%d %H:%M:%S")
@dataset.literal(t).should == "#{s}#{@offset}'"
end

Expand Down
2 changes: 1 addition & 1 deletion spec/integration/timezone_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_timezone
test_timezone
end

specify "should support using local time for both database storage and for application" do
cspecify "should support using local time for both database storage and for application", [:do, proc{|db| db.database_type != :sqlite}] do
Sequel.default_timezone = :local
test_timezone
end
Expand Down

0 comments on commit 81f2dd2

Please sign in to comment.