| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* ASCII_STRING was not an ASCII String
* BYTE_STRING was not an in valid UTF-8 String
* added an assertion for non-UTF-8 String
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Use the standard library's `DateTime.parse` because it's marginally
faster and supports partial date/time strings.
Benchmark:
user system total real
old 3.980000 0.000000 3.980000 ( 3.987606)
new 3.640000 0.010000 3.650000 ( 3.641342)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit standardises the return value of `to_time` to an instance
of `Time` in the local system timezone, matching the Ruby core and
standard library behavior.
The default form for `String#to_time` has been changed from :utc to
:local but research seems to suggest the latter is the more common form.
Also fix an edge condition with `String#to_time` where the string has
a timezone offset in it and the mode is :local. e.g:
# Before:
>> "2000-01-01 00:00:00 -0500".to_time(:local)
=> 2000-01-01 05:00:00 -0500
# After:
>> "2000-01-01 00:00:00 -0500".to_time(:local)
=> 2000-01-01 00:00:00 -0500
Closes #2453
|
|
|
|
| |
Closes #8587
|
| |
|
|
|
|
|
| |
This reverts commit 88cc1688d0cb828c17706b41a8bd27870f2a2beb, reversing
changes made to f049016cd348627bf8db0d72382d7580bf802a79.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
I did this because to_date gives a very unhelpful error message if you
do not pass in a correct date. In the process I think this cleans up the
code nicely and even better it tends to be slightly faster than the
current implementation.
Benchmark
https://gist.github.com/4440875
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Date, DateTime, Time and TimeWithZone can now be compared to infinity,
so it's now possible to create ranges with one infinite bound and
date/time object as another bound.
Ex.: @range = Range.new(Date.today, Float::INFINITY)
Also it's possible to check inclusion of date/time in range with
conversion.
Ex.: @range.include?(Time.now + 1.year) # => true
@range.include?(DateTime.now + 1.year) # => true
Ability to create date/time ranges with infinite bound is required
for handling postgresql range types.
|
| |
|
|\
| |
| | |
WIP Refactor xml conversion to hash
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Three basic refactors in this PR:
* We extracted the logic into a method object. We now don't define a tone of extraneous methods on Hash, even if they were private.
* Extracted blocks of the case statement into methods that do the work. This makes the logic more clear.
* Extracted complicated if clauses into their own query methods. They often have two or three terms, this makes it much easier to see what they _do_.
We took care not to refactor too much as to not break anything, and put comments where we suspect tests are missing.
We think ActiveSupport::XMLMini might be a good candidate to move to a plugin in the future.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
The Time.time_with_datetime_fallback, Time.utc_time and Time.local_time
methods were added to handle the limitations of Ruby's native Time
implementation. Those limitations no longer apply so we are deprecating
them in 4.0 and they will be removed in 4.1.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The to_time_in_current_zone method doesn't match the naming of the methods
for converting to ActiveSupport::TimeWithZone on Time and DateTime. Since
DateTime inherits from Date that has led to confusion with some users
using the to_time_in_current_zone method with DateTime instances and having
the time part dropped and the UTC offset lost.
This commit fixes this by deprecating the old method and adding a new
in_time_zone method which matches the naming for DateTime and Time. This
should prevent accidently dropping times and UTC offsets when converting
DateTime instances to ActiveSupport::TimeWithZone.
|
|/
|
|
|
|
| |
This commit adds a convenience method for converting a string to an
ActiveSupport::TimeWithZone instance using the configured Time.zone or
another passed as an argument.
|
|
|
|
|
| |
AS::BasicObject is used for proxy classes. Let's give it a less concerning
name. Also, it avoids the confusion with Ruby's Basic Object.
|
|
|
|
| |
(active_support/dependecies.rb) (issue #8167)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
This file is used at least by Active Merchant, its existence
is maybe not necessary but no big deal either.
This reverts commit ae9b3d7cecd77b9ace38671b183e1a360bf632b6.
|
|\
| |
| | |
make Hash#extract! more symmetric with Hash#slice
|
| | |
|
| | |
|
| |
| |
| |
| | |
object/to_(param|query).rb
|
| | |
|
| | |
|
|/ |
|
| |
|
|\
| |
| | |
Nice and easy delegation to the class
|
| | |
|
| |
| |
| |
| | |
option added (default is Monday)
|
|/
|
|
|
| |
Hash#merge accepts block that you can use to customize how hash values
are merged. This change makes merge and deep_merge compatible.
|
| |
|
|
|
|
|
| |
Check 0180e090ab6cbe66f7b521a0c03e278a0463accd for more reasoning about
that.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a block is passed into the method, it will be invoked for each
duplicated key, with the key in question and the two values as
arguments. The value for the duplicated key in the receiver will
be set to the return value of the block.
This behaviour matches Ruby's long-standing implementation of
Hash#update and is intended to provide a more consistent interface.
HashWithIndifferentAccess#merge is also affected by the change, as it
uses #update internally.
|
|\
| |
| | |
Refactored common date and time calculations.
|