aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
Commit message (Collapse)AuthorAgeFilesLines
* Fix Range#sum optimized versionAlexey Vakhov2012-05-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | At 1bd4d1c67459a91415ee73a8f55d2309c0d62a87 was added Range#sum optimized version for arithmetic progressions. This improvment injected a defect with not integer range boundaries. The defect was fixed by e0adfa82c05f9c975005f102b4bcaebfcd17d241. The second commit really disabled optimization at all because in Ruby integer-valued numbers are instances of Fixnum and Bignum classes. We should #use is_a? (#kind_of?) method instead #instance_of? to check if value is numerical: 1.class # => Fixnum 1.instance_of?(Integer) # => false 1.is_a?(Integer) # => true -100_000_000_000.class # => Bignum -100_000_000_000.instance_of?(Integer) # => false -100_000_000_000.is_a?(Integer) # => true Moreover original implementation of Range#sum has a defect with reverse range boundaries. If the first boundary is less than the second range is empty. Current commit fixes and tests this case too.
* Add missing requires for deep_dup and hash ext testCarlos Antonio da Silva2012-05-241-0/+1
|
* Use deep_dup in the deep_transform_keys tests.Rafael Mendonça França2012-05-241-20/+98
| | | | | | | | Using only dup make some tests to not catch up an implementation error because the methods were changing the nested hashes. Related to: https://github.com/rails/rails/commit/541429fbe49b0671adb3842ab1818230d670ef9f#L1R96
* Add Hash#deep_transform_keys and Hash#deep_transform_keys! Also convert ↵Mark McSpadden2012-05-231-1/+16
| | | | deep_*_keys to use deep_transform_keys.
* Adding deep versions of stringify_keys and symbolize_keys (plain and bang) ↵Lucas Húngaro2012-05-231-0/+92
| | | | for nested hashes
* Add Hash#transform_keys and Hash#transform_keys! and refactor *_keys methods ↵Mark McSpadden2012-05-231-0/+15
| | | | to use them.
* changed xml type datetime to dateTime, fixes #6328Angelo capilleri2012-05-231-2/+2
| | | | | | | | | XmlMini define the xml 'datatime', but according to http://www.w3.org/TR/xmlschema-2/#dateTime could be better change this to 'dateTime' with upper case letter 'T. So 'DateTime' and 'Time' are redefined from 'datetime' to 'dateTime' add the changing to the changelog
* Add instance_accessor option to class_attributeAlexey Vakhov2012-05-221-0/+7
|
* Merge pull request #6376 from jgaskins/timestamp-microsecondsJeremy Kemper2012-05-181-1/+3
|\ | | | | Increase numeric-timestamp precision to nanoseconds
| * Increase `AR#cache_key` precision to nanosecondsJamie Gaskins2012-05-191-1/+3
| |
* | Merge pull request #6183 from nashby/fix-issue-6179Jeremy Kemper2012-05-183-33/+49
|\ \ | | | | | | wrap time ranges with timezones
| * | respect nsec in TimeWithZoneVasiliy Ermolovich + Sergey Nartimov2012-05-183-35/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when we pass fractional usec to Time methods we should use Rational instead of Float because of accuracy problem Time.local(2011,6,12,23,59,59,999999.999).nsec # => 999999998 Time.local(2011,6,12,23,59,59,Rational(999999999, 1000)).nsec # => 999999999
| * | wrap time ranges with timezones, closes #6179Vasiliy Ermolovich2012-05-171-1/+9
| | |
* | | Fix warning: possibly useless use of % in void contextkennyj2012-05-191-1/+1
| | |
* | | doesn't modify params in SafeBuffer#%Vasiliy Ermolovich2012-05-181-0/+7
| |/ |/|
* | Remove special cases for duplicable? on Class and ModuleMark McSpadden2012-05-171-2/+2
| |
* | fix safe string interpolation with SafeBuffer#%, closes #6352Vasiliy Ermolovich2012-05-161-0/+24
| |
* | remove useless tests for Range#stepVasiliy Ermolovich2012-05-131-10/+0
| |
* | Remove blockless_step leave all that up to RubySantiago Pastorino2012-05-131-1/+1
| | | | | | | | Closes #6297
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-05-121-2/+2
|\ \ | | | | | | | | | | | | Conflicts: activesupport/lib/active_support/callbacks.rb
| * | Fix copypaste. [ci skip]Edward Tsech2012-05-111-2/+2
| | |
* | | Object#try can't call private methodsVasiliy Ermolovich2012-05-121-1/+13
| | |
* | | Test Hash#except can receive more than one argument.Edward Tsech2012-05-111-0/+6
|/ /
* | Merge pull request #6064 from gazay/fix_guides_for_as_core_extXavier Noria2012-05-071-0/+12
|\ \ | |/ |/| Fix guides for as core ext
| * Added tests for comparsion operator for RangeAlexey Gaziev2012-05-071-0/+12
| |
* | Keep all methods in object/deep_dupPiotr Sarnacki2012-05-061-2/+1
| |
* | Nice logic for deep_dup in railsAlexey Gaziev2012-05-062-15/+54
| |
* | Merge pull request #6169 from marcandre/respond_to_missingJosé Valim2012-05-051-0/+1
|\ \ | | | | | | Respond to missing
| * | Use respond_to_missing for TimeWithZoneMarc-Andre Lafortune2012-05-051-0/+1
| |/
* | Merge pull request #6156 from mjtko/feature-beginning_of_hourJeremy Kemper2012-05-043-0/+30
|\ \ | | | | | | Beginning and end of hour support for Time and DateTime
| * | added beginning_of_hour support to core_ext calculations for Time and DateTimeMark J. Titorenko2012-05-043-0/+30
| |/
* / enable tests for beginning_of_* and end_of_* within time zone tests; enable ↵Mark J. Titorenko2012-05-041-8/+8
|/ | | | test for future_with_time_current_as_time_with_zone; fix beginning_of_month test.
* Tests for regexp separator in String#truncateAlexey Gaziev2012-04-291-0/+6
| | | | https://github.com/rails/rails/commit/5a7513593f64e0ff7e4de1ee37bac5eeddfae270
* Optimize the performance of #delegateDaniel Schierbeck2012-04-121-0/+19
| | | | | | Remove the use of #__send__ in order to boost performance. This also means that you can no longer delegate to private methods on the target object.
* validate attribute names in class and module attribute accessorsDmitry Plashchynski2012-03-302-0/+28
|
* fix HashWithIndifferentAccess.[] methodSergey Nartimov2012-03-231-0/+9
|
* deprecate Proc#bind that can cause symbol memory leakSergey Nartimov2012-03-221-5/+7
|
* bigdecimal can be duped on Ruby 2.0Aaron Patterson2012-03-201-2/+10
|
* Remove warning of unused variableRafael Mendonça França2012-03-081-1/+1
|
* refactor Hash#slice and Hash#extract!Vasiliy Ermolovich2012-03-061-0/+7
|
* remove usages of AS::OrderedHashVishnu Atrai2012-03-032-3/+3
|
* Merge pull request #4284 from mattdbridges/time_calculation_aliasesXavier Noria2012-02-283-0/+58
|\ | | | | Added aliases for prev_year, prev_month, and prev_week in Time and Date calculations
| * Adding :last_week, :last_month, and :last_year aliases to Time and DateMatt Bridges2012-02-213-0/+58
| | | | | | | | core extensions
* | make Range#overlaps? accept Range of TimeShigeya Suzuki2012-02-091-0/+12
| |
* | Merge pull request #4878 from vijaydev/ordinal-2072Xavier Noria2012-02-071-0/+5
|\ \ | | | | | | PR #2072 with docs
| * | Document Integer#ordinal available in PR #2072.Vijay Dev2012-02-041-1/+0
| | | | | | | | | | | | Also remove an unasserted line in the tests.
| * | Add ActiveSupport::Inflector.ordinal and Integer#ordinalTim Gildea2012-02-041-0/+6
| | |
* | | Optional start_day argument for Time#all_week.kennyj2012-02-061-0/+1
|/ / | | | | | | Closes #4883
* | remove unasserted line in testVijay Dev2012-02-041-1/+0
| |
* | Deprecate DateTime.local_offsetbrainopia2012-01-252-15/+6
| |