aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
Commit message (Collapse)AuthorAgeFilesLines
* Module#delegate checks nilness rather that falsehood if :allow_nil is true, ↵Xavier Noria2013-04-261-30/+42
| | | | | | | | | | | | | | and avoids multiple evaluation of the target method Notes: 1) I hope nilness is a word. 2) See rationale for avoiding multiple evaluation in a comment in the patch, credit goes to @jeremy for pointing out this gotcha in the existing implementation. 3) Embeds a little joke dedicated to @pixeltrix (it could be worse! :D). References #10347.
* Merge pull request #10351 from ↵Xavier Noria2013-04-261-5/+5
|\ | | | | | | | | JonRowe/update_as_date_next_week_to_document_intent Propose better documentation for ActiveSupports `next_week` functionaility
| * formattingJon Rowe2013-04-261-1/+1
| |
| * better document `next_week` functionaility closes #9568Jon Rowe2013-04-261-5/+5
| |
* | Delegation method bugLi Ellis Gallardo2013-04-251-0/+14
|/ | | | | | Add documentation and test to delegation method that make sure we're aware that when a delegated object is not nil or false and doesn't respond to the method it will still raise a NoMethodError exception.
* Adjust for daylight savings in String#to_timeAndrew White2013-04-231-8/+6
| | | | | | | | | | | | | | | The changes in b79adc4323 had a bug where if the time in the String was in standard time but the current time was in daylight savings then the calculated adjustment was off by an hour. This commit fixes this and adds extra tests for the following: * time in string is standard time, current time is standard time * time in string is standard time, current time is daylight savings * time in string is daylight savings, current time is standard time * time in string is daylight savings, current time is daylight savings Fixes #10306.
* more descriptive NameError's messages for class attributesHrvoje Šimić2013-04-171-2/+2
|
* The third argument of deprecation_warning is always optionalRafael Mendonça França2013-04-161-1/+1
| | | [ci skip]
* Fix documentation to the custom DeprecatorRafael Mendonça França2013-04-161-1/+1
| | | [ci skip]
* interpolate instead of string concatVipul A M2013-04-151-1/+1
|
* Corrected paramter to parameterCarson McDonald2013-04-131-1/+1
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-04-113-5/+14
|\ | | | | | | | | Conflicts: guides/source/action_mailer_basics.md
| * fix Array#uniq_by! docs [ci skip]Francesco Rodriguez2013-04-041-2/+2
| |
| * add documentation to Benchmark#ms [ci skip]Francesco Rodriguez2013-04-041-0/+7
| |
| * fix broken format in Array#to_sentence [ci skip]Francesco Rodriguez2013-04-041-3/+5
| |
* | Revert "Merge pull request #10158 from steveklabnik/issue_10125"Rafael Mendonça França2013-04-101-2/+2
| | | | | | | | | | | | | | | | This reverts commit fa3ef8e82ab2f96cf15ef9bc885b2468fad77621, reversing changes made to e0af93dd3a5eeee2e2a67b05f34afb66cc80c00b. Reason: Routes, Active Record and the rendering stack should not depend on the default locale
* | Fix inflector to respect default locale.Nick Cox2013-04-101-2/+2
| | | | | | | | | | | | | | | | The inflector was made aware of locales in 7db0b073fec6bc3e6f213b58c76e7f43fcc2ab97, but it defaulted to :en. That should actually be our default locale instead. Fixes #10125
* | Add option to Class#class_attribute for skipping the query methodAgis-2013-04-061-3/+5
| |
* | `fast_xs` support has been removed. Use 'String#encode(xml: :attr)`.Aaron Patterson2013-04-052-19/+0
| |
* | Merge pull request #10080 from vipulnsward/railties_warning_fix_v2Steve Klabnik2013-04-031-0/+1
|\ \ | | | | | | add require to suppress warning; remove variable
| * | add require to suppress warning; remove variableVipul A M2013-04-041-0/+1
| | |
* | | Fixed TypoPrathamesh Sonpatki2013-04-041-1/+1
|/ /
* / fix some typos in ASVipul A M2013-03-301-1/+1
|/
* removing out of date comment. ↵Aaron Patterson2013-03-121-3/+0
| | | | :heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart: @pixeltrix
* drop memory consumption and startup speed by switching to define_methodAaron Patterson2013-03-121-23/+28
|
* Call String#gsub with Hash directlyAman Gupta2013-03-041-2/+2
|
* Keep second fraction when DateTime#change is called.Chris Baynes2013-02-251-1/+1
|
* Correct comment for (beginning|end)_of_minuteGert Goet2013-02-222-4/+4
|
* Added beginning_of_minute support to core_ext calculations for Time and DateTimeGagan Awhad2013-02-212-0/+27
|
* Change Class#subclasses doc exampleDalibor Nasevic2013-02-061-2/+2
|
* revamps the RDoc of Object#tryXavier Noria2013-01-281-22/+30
|
* no need for \Z, \z is more conciseXavier Noria2013-01-281-1/+1
|
* Merge pull request #8830 from antoinelyset/masterXavier Noria2013-01-281-2/+5
|\ | | | | Improve String#squish whitespaces matching
| * Improve String#squish whitespaces matchingAntoine Lyset2013-01-221-2/+5
| |
* | Merge remote-tracking branch 'docrails/master'Xavier Noria2013-01-261-1/+1
|\ \ | |/ |/| | | | | | | Conflicts: actionpack/lib/action_view/helpers/form_options_helper.rb guides/code/getting_started/app/controllers/comments_controller.rb
| * Clarified the minute option on DateTime#changeJakob Waller2013-01-101-1/+1
| |
* | Use `DateTime.parse` inside `String#to_datetime`Andrew White2013-01-211-8/+1
| | | | | | | | | | | | | | | | | | | | 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)
* | Standardise the return value of `to_time`Andrew White2013-01-211-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | remove_possible_method -> remove_methodNihad Abbasov2013-01-111-2/+2
| | | | | | | | Date#to_time and Date#xmlschema methods defined in Ruby 1.9.3
* | Updating Array access docs more consistentMatt Bridges2013-01-101-4/+4
| | | | | | | | [ci skip]
* | CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml.Jeremy Kemper2013-01-081-4/+23
| |
* | Revert "Merge branch 'master-sec'"Jeremy Kemper2013-01-081-23/+4
| | | | | | | | | | This reverts commit 88cc1688d0cb828c17706b41a8bd27870f2a2beb, reversing changes made to f049016cd348627bf8db0d72382d7580bf802a79.
* | Merge branch 'master-sec'Aaron Patterson2013-01-081-4/+23
|\ \ | |/ |/| | | | | | | * master-sec: CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml. * Strip nils from collections on JSON and XML posts. [CVE-2013-0155] * dealing with empty hashes. Thanks Damien Mathieu
| * CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml.Jeremy Kemper2013-01-081-4/+23
| |
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-01-093-6/+6
|\ \ | |/ |/| | | | | Conflicts: guides/source/getting_started.md
| * Correct method notation for #acts_like? [ci skip]Doug Yun2013-01-071-4/+4
| |
| * Instance_variable_names are strings. That is the most important information IMOAkira Matsuda2013-01-081-1/+1
| |
| * prefer american spelling of 'behavior'Gosha Arinich2013-01-071-1/+1
| |
* | Revert some warning removals related to Ruby 2.0Carlos Antonio da Silva2013-01-072-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These warnings were actually a bug in Ruby 2.0, the accessors should not be raising such warnings, they are only meant for ivars. - Revert "fix warnings in Ruby 2.0" This reverts commit 26702a6d3461f4a1c75165030b96886514ecb877. - Revert "Merge pull request #8282 from arunagw/warning_removed_for_ruby2" This reverts commit f63d6544e45e78cda29c0c56fbdf3d9e1f405340, reversing changes made to 3a890681fad8218305585036abed6d7463a44e41.
* | Require 'active_support/core_ext/module/aliasing' in the infinite_comparable ↵Diogo Mafra2013-01-061-0/+1
| | | | | | | | module