aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_support_core_extensions.md
Commit message (Collapse)AuthorAgeFilesLines
* Remove caveat for older Ruby's `dup` behavior [ci skip]Ryuta Kamizono2019-07-161-9/+0
| | | | | In older Ruby, nil, Symbol, Fixnum, Rational, and Complex were not duplicable. In Ruby 2.5, all of them are duplicable.
* Delete mention of Ruby 1.9 [skip ci]soartec-lab2019-07-151-4/+0
|
* Delete `DateAndTime` method definition in rails that is compatible with ruby ↵soartec-lab2019-06-161-22/+22
| | | | | | | | | | | | definition Tests are also only on the `Time` class Update doc forgetting to erase when moved Update guide `Date` class to `Time` class and defined file Update guide correction omission
* Delete 'ruby' in the description of the method defined in rails [skip ci]soartec-lab2019-06-161-3/+3
|
* Merge pull request #36348 from corprew/docs-stringify-keys-stable-resultRyuta Kamizono2019-05-281-8/+4
|\ | | | | | | [documentation][ci skip] stringify_keys and symbolize_keys have stable results.
| * stringify_keys and symbolize_keys have stable results.Corprew Reed2019-05-271-8/+4
|/ | | | | | | Rails 6 uses the `Hash.transform_keys` found in Ruby 2.5 and later, and that method enumerates keys based on insertion order. Calling `symbolize_keys`, `stringify_keys`, and their bang variants will result in the same hash every time -- the value for any key where a collision occurs is the last assigned in that enumeration In the docs for Hash -- https://ruby-doc.org/core-2.5.0/Hash.html > Hashes enumerate their values in the order that the corresponding keys were inserted.
* Update `multiline?` sample code [ci skip]soartec-lab2019-03-071-2/+2
|
* Corrected execution result of Enumerable#sum [ci skip]soartec-lab2019-03-071-1/+1
|
* Learn more about inflections[ci skip]soartec-lab2019-03-071-1/+1
|
* Add a link to where "inquiry" is defined in ActiveSupport docsStephen Pike2019-02-041-0/+2
| | | | [ci skip]
* Follow up #34754bogdanvlviv2018-12-201-20/+1
| | | | | | | - Fix a few deprecation warnings - Remove testing of `Hash#slice` - Imporve test of `Hash#slice!` - Remove mention about `Hash#slice` from the guide
* Use native `Array#append`, `Array#prepend`, `Hash#transform_keys`, and ↵Ryuta Kamizono2018-12-201-66/+0
| | | | | | | | | | `Hash#transform_keys!` Since Rails 6 requires Ruby 2.5. https://github.com/ruby/ruby/blob/ruby_2_5/NEWS Follow up #34754.
* Fix the docs for Module#parents and related methods in guides [ci skip]Prathamesh Sonpatki2018-10-031-16/+16
| | | | - Followup of https://github.com/rails/rails/pull/34051
* Add `Array#extract!`bogdanvlviv2018-08-141-0/+13
| | | | | | | | | | | The method removes and returns the elements for which the block returns a true value. If no block is given, an Enumerator is returned instead. ``` numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] odd_numbers = numbers.extract! { |number| number.odd? } # => [1, 3, 5, 7, 9] numbers # => [0, 2, 4, 6, 8] ```
* Rails guides are now served over httpsPaul McMahon2018-07-241-1/+1
| | | | | http links will be redirected to the https version, but still better to just directly link to the https version.
* Update "Active Support Core Extensions" Guidebogdanvlviv2018-06-121-76/+56
| | | | | | | | | | | | | | Remove general sentence that explains that all methods that Active Support brings to `Date` `Time`, `DateTime` are defined in `active_support/core_ext/date/calculations.rb` since it isn't true. Add a references to an appropriate file where methods are defined like it is done with the other methods in this guide. Context https://github.com/rails/rails/pull/32552#discussion_r181216246 Related to #32543, #32552 [ci skip]
* Fix example of `index_with`bogdanvlviv2018-06-071-2/+2
| | | | | | | | | | - Clarify executor of `public_send`. - Do not wrap `Interval.all_day` into [] since an array is expected as a returned value. Related to #32523. [ci skip]
* add CHANGELOG/Docutilum2018-05-221-7/+12
|
* [ci skip] Add documentation/changelog entry.Kasper Timm Hansen2018-05-211-0/+15
|
* [ci skip] Add :private option to delegate section in guideYoshiyuki Hirano2018-04-041-0/+8
|
* Revert "[ci skip] Capitalize sentence of first char in AS guide"Andrew White2018-03-311-1/+1
| | | | | | | The text is a continuation of the sentence before the listing so doesn't need to begin with a capital letter. This reverts commit 77a7acafba11fccac8b4cf30a9ce62d43a9ac186.
* [ci skip] Capitalize sentence of first char in AS guideYoshiyuki Hirano2018-03-311-1/+1
|
* Deprecate `active_support/core_ext/hash/compact`yuuji.yaginuma2018-03-021-10/+0
| | | | | Ruby 2.4+ provides `Hash#compact` and `Hash#compact!` natively, so `active_support/core_ext/hash/compact` is no longer necessary.
* Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-171-62/+11
| | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* Change structure of AS core extensions [ci skip]Yauheni Dakuka2018-02-121-9/+9
|
* Suppress `warning: BigDecimal.new is deprecated`Yasuo Honda2017-12-151-3/+3
| | | | | | | | | | | | | | | | | | | | `BigDecimal.new` has been deprecated in BigDecimal 1.3.3 which will be a default for Ruby 2.5. Refer https://github.com/ruby/bigdecimal/commit/533737338db915b00dc7168c3602e4b462b23503 * This commit has been made as follows: ``` cd rails git grep -l BigDecimal.new | grep -v guides/source/5_0_release_notes.md | grep -v activesupport/test/xml_mini_test.rb | xargs sed -i -e "s/BigDecimal.new/BigDecimal/g" ``` - `activesupport/test/xml_mini_test.rb` Editmanually to remove `.new` and `::` - guides/source/5_0_release_notes.md This is a Rails 5.0 release notes.
* Update "Active Support Core Extensions" guidebogdanvlviv2017-10-241-91/+97
|
* Allows pass argument for `Time#prev_year` and `Time#next_year`.bogdanvlviv2017-10-241-4/+6
|
* Allows pass argument for `Time#prev_month` and `Time#next_month`bogdanvlviv2017-10-241-5/+7
|
* Make clear that Time core extensions are split between Numeric and IntegerJoão Fernandes2017-10-241-5/+29
| | | | | | | The documentation wrongly suggests that Time extensions to Numeric include methods months and years, when these belong to Integer. Update both classes and guides.
* Fix default of `String#to_time` [ci skip]yuuji.yaginuma2017-10-081-1/+1
| | | | The default of `String#to_time` is `:local` since b79adc4.
* Remove mentions about `Module#reachable?` in "Active Support Core ↵bogdanvlviv2017-09-171-39/+0
| | | | Extensions" guide
* fix type fully qualified [ci skip]Yauheni Dakuka2017-09-061-3/+3
|
* Clarify intentions around method redefinitionsMatthew Draper2017-09-011-1/+5
| | | | | | | | | Don't use remove_method or remove_possible_method just before a new definition: at best the purpose is unclear, and at worst it creates a race condition. Instead, prefer redefine_method when practical, and silence_redefinition_of_method otherwise.
* Remove trailing spaces [ci skip]Ryuta Kamizono2017-08-271-2/+2
|
* Merge pull request #30394 from ydakuka/fixing-indentationRyuta Kamizono2017-08-241-2/+2
|\ | | | | Fix indentation [ci skip]
| * Fix indentation [ci skip]Yauheni Dakuka2017-08-241-2/+2
| |
* | Update active_support_core_extensions.md [ci skip]Yauheni Dakuka2017-08-241-2/+2
|/
* Add documentation for class_attribute optionsGlauco Custódio2017-07-171-2/+1
|
* Missing dots [ci skip] (#29414)Vipul A M2017-06-111-4/+4
|
* Merge pull request #29268 from gsamokovarov/delegate-missing-to-guidesVipul A M2017-06-111-0/+21
|\ | | | | Document Module#delegate_missing_to in the guides [ci skip]
| * Document Module#delegate_missing_to in the guidesGenadi Samokovarov2017-06-111-0/+21
| | | | | | | | | | Added a small section for it in the `Active Support Core Extensions` guide. [ci skip]
* | Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-031-5/+3
|/
* Revert "Merge pull request #27686 from koic/friendly_bigdecimal_inspect"Kasper Timm Hansen2017-01-151-9/+1
| | | | | | | | | | | | | The exact inspect output of a BigDecimal is out of scope for what we're trying to communicate about `dup` and `duplicable?` here. Adding two examples distracts is disctracting, so keep the docs from before since our minimal version is Ruby 2.2.2. [ Koichi ITO, Jon Moss, Kasper Timm Hansen ] This reverts commit 2163874dedaf83e67599c2930c2686caa165fbad, reversing changes made to 46fdbc5290335ed38fa9fe2b6b0ef8abe4eccb1b.
* Several representation of BigDecimal has changed in Ruby 2.4.0+ [ci skip]Koichi ITO2017-01-151-1/+9
| | | | cf. https://github.com/ruby/bigdecimal/pull/42
* [ci skip] Rejigger the dublicable? wording a bit.Kasper Timm Hansen2016-12-291-9/+12
|
* Update list of `duplicable?` objects in AS core_ext guide [ci skip]utilum2016-12-231-17/+31
| | | | | | | | | | | Complex and Rational objects can not be duplicated. Duplicable objects in Ruby 2.4.0 include: - most numbers - symbols - `nil` - `true` - `false`
* remove `alias_method_chain` from guide [ci skip]yuuji.yaginuma2016-11-151-50/+0
| | | | Follow up to 7c848e6dd493ff236d33a0410a92f4c3e5cc3c7f
* [ci skip] Fix return values of Hash Extensions examplesBruno Facca2016-10-201-4/+4
| | | | | | | | The hashes returned in some examples of the following sections had items in a different order than their receivers. That may mislead readers into believing those methods will not preserve element order. Extensions to Hash/Working with Keys/transform_keys and transform_keys! Extensions to Hash/Working with Keys/stringify_keys and stringify_keys! Extensions to Hash/Working with Keys/symbolize_keys and symbolize_keys! Extensions to Hash/Slicing
* [ci skip] Simply formatting documentsNeodelf2016-09-061-1/+1
|