aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
Commit message (Collapse)AuthorAgeFilesLines
* Fix `singleton_class?`Vipul A M2015-01-021-3/+5
| | | | | | | | Due to changes from http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39628 current `singleton_class?` implementation fails. Changed based on reference from http://bugs.ruby-lang.org/issues/7609 Conflicts: activesupport/lib/active_support/core_ext/class/attribute.rb
* fix yaml compat on ruby 2.2Aman Gupta2015-01-021-1/+3
|
* Check `respond_to` before delegation due to: ↵Aaron Patterson2014-12-221-1/+7
| | | | https://github.com/ruby/ruby/commit/d781caaf313b8649948c107bba277e5ad7307314
* Add missing require so that DateTime has the right superclassAndrew White2013-07-101-0/+1
| | | | | | | | | | If the DateTime core extensions were loaded before the Date core extensions then you would get a superclass mismatch as DateTime hasn't been defined yet so it gets set to Object by the acts_like core extension. Fixes #11206 (cherry picked from commit 78f7d5b652000dbb1a11d34fe370c3fa82de840c)
* Return local time for backwards compatibilityAndrew White2013-07-091-1/+1
|
* Retain offset and fraction when using Time.at_with_coercionAndrew White2013-07-091-3/+8
| | | | | | | | | | | | | | | | The standard Ruby behavior for Time.at is to return the same type of time when passing an instance of Time as a single argument. Since the an ActiveSupport::TimeWithZone instance may be a different timezone than the system timezone and DateTime just understands offsets the best we can do is to return an instance of Time with the correct offset. It also maintains the correct fractional second value as well. Fixes #11350. Backports: 484253515c0e05760541dc48946361185c9e6904 1b3873730b96035a238dbff7627bd5942e6dc4e7
* Remove warning of assigned but unused variableRafael Mendonça França2013-07-061-1/+1
|
* Override Time.at to work with Time-like valuesAndrew White2013-06-081-0/+12
| | | | | | | Time.at allows passing a single Time argument which is then converted to an integer. The conversion code since 1.9.3r429 explicitly checks for an instance of Time so we need to override it to allow DateTime and ActiveSupport::TimeWithZone values.
* search private and protected methods for convert_keyAaron Patterson2013-02-242-3/+2
|
* Add in missing requiresPrem Sichanugrist2013-02-241-0/+2
|
* Fix DateTime comparison with DateTime::Infinity objectDan Kubb2013-01-131-1/+1
|
* Merge branch '3-2-sec' into 3-2-secmergeAaron Patterson2013-01-081-7/+25
|\ | | | | | | | | | | | | | | | | | | | | | | | | * 3-2-sec: bumping version 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 Avoid Rack security warning no secret provided Conflicts: actionpack/CHANGELOG.md activerecord/CHANGELOG.md activesupport/CHANGELOG.md
| * CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml.Jeremy Kemper2013-01-081-7/+25
| |
* | Wrap time ranges with timezones, closes #8807Vasiliy Ermolovich2013-01-081-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit e2e513621d732abb8efff9120bd9a444836720d6) (cherry picked from commit dcdde7da481e11660634278a8004175a1ce20f39) Backport of #6183, original issue was #6179 Conflicts: activesupport/lib/active_support/core_ext/time/calculations.rb activesupport/test/core_ext/time_ext_test Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
* | Add :nsec format only for Ruby 1.9Carlos Antonio da Silva2012-12-111-1/+2
| | | | | | | | | | | | Ruby 1.8 does not support this format in Time, so the format will only be added to the available date formats on Ruby 1.9. Changelog entry was changed to explain that as well.
* | Merge pull request #6376 from jgaskins/timestamp-microsecondsJeremy Kemper2012-12-101-0/+1
| | | | | | | | | | | | Increase numeric-timestamp precision to nanoseconds Conflicts: activesupport/lib/active_support/core_ext/time/conversions.rb
* | Use send in Time marshal extensions since the methods are now privateCarlos Antonio da Silva2012-12-031-2/+2
| | | | | | | | | | | | | | See https://github.com/ruby/ruby/commit/9c1b3161f20162dc1682d758c0e4d2fc3a74745e All Active Support tests pass in 2.0.0preview2 after this change. Closes #8409
* | Merge pull request #8027 from daenney/masterXavier Noria2012-11-081-2/+7
|/ | | | | | | | Atomic.rb assumes it may chown/chmod a file but doesn't handle the EPERM error. Conflicts: activesupport/CHANGELOG.md guides/source/active_support_core_extensions.md
* Adding a missing parenthesis in the doc of String#parameterize.Geoffrey Roguelon2012-10-241-1/+1
|
* Fix html_escape with Ruby 1.8Rafael Mendonça França2012-08-021-15/+26
|
* html_escape should escape single quotesSantiago Pastorino2012-08-021-28/+16
| | | | | | | | | | | | https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content Closes #7215 Conflicts: actionpack/test/template/erb_util_test.rb actionpack/test/template/form_tag_helper_test.rb actionpack/test/template/text_helper_test.rb actionpack/test/template/url_helper_test.rb activesupport/lib/active_support/core_ext/string/output_safety.rb
* adds a missing require [fixes #6896]Xavier Noria2012-07-152-1/+1
| | | | | This file uses Time.zone, which is defined in active_support/core_ext/time/zones.rb.
* Merge pull request #6857 from rsutphin/as_core_ext_time_missing_requireCarlos Antonio da Silva2012-06-251-0/+1
| | | | Missing require breaks Time.=== when selectively loading ActiveSupport core_exts in 3.2.4+
* Improve docs for `try` by adding note on `BasicObject`Piotr Sarnacki2012-05-201-0/+4
| | | | [ci skip] closes #5790
* Backporting some docs on core_ext/hashFrancesco Rodriguez2012-05-153-4/+23
|
* adding examples and docsFrancesco Rodriguez2012-05-123-1/+22
|
* fix attribute_accessors docs to support 1.8 syntaxFrancesco Rodriguez2012-05-091-11/+11
|
* removing docs duplicationFrancesco Rodriguez2012-05-081-23/+0
|
* Merge pull request #6211 from frodsan/docs_attr_accessor_32stableVijay Dev2012-05-081-0/+111
|\ | | | | Adding docs to attribute accessor methods.
| * added docs to attribute_accessors methodsFrancesco Rodriguez2012-05-081-0/+111
| |
* | added beginning_of_hour support to core_ext calculations for Time and DateTimeMark J. Titorenko2012-05-042-0/+26
|/
* Remove circular require of time/zonesOscar Del Ben2012-04-291-1/+0
|
* Add missing require in Active Support time zones (fixes #5854)Piotr Sarnacki2012-04-151-0/+1
| | | | | I also removed the other require as it's already present in `activesupport/core_ext/time/calculations`
* probably should require the objects we monkey patch.Aaron Patterson2012-04-101-0/+1
|
* bigdecimal can be duped on Ruby 2.0Aaron Patterson2012-04-101-0/+12
| | | | | | Conflicts: activesupport/test/core_ext/duplicable_test.rb
* Stop SafeBuffer#clone_empty from issuing warningsCarlos Antonio da Silva2012-03-021-3/+1
| | | | | | | | | | | | Logic in clone_empty method was dealing with old @dirty variable, which has changed by @html_safe in this commit: https://github.com/rails/rails/commit/139963c99a955520db6373343662e55f4d16dcd1 This was issuing a "not initialized variable" warning - related to: https://github.com/rails/rails/pull/5237 The logic applied by this method is already handled by the [] override, so there is no need to reset the variable here.
* Merge branch '3-2-2' into 3-2-stableAaron Patterson2012-03-011-16/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | * 3-2-2: bumping to 3.2.2 Ensure [] respects the status of the buffer. Merge pull request #4834 from sskirby/fix_usage_of_psql_in_db_test_prepare Merge pull request #5084 from johndouthat/patch-1 updating RAILS_VERSION delete vulnerable AS::SafeBuffer#[] use AS::SafeBuffer#clone_empty for flushing the output_buffer add AS::SafeBuffer#clone_empty fix output safety issue with select options
| * Ensure [] respects the status of the buffer.José Valim2012-02-291-12/+18
| |
| * delete vulnerable AS::SafeBuffer#[]Akira Matsuda2012-02-201-6/+0
| |
| * add AS::SafeBuffer#clone_emptyAkira Matsuda2012-02-201-0/+6
| |
* | call binmode on the tempfile for Ruby 1.8 compatibilityAaron Patterson2012-02-271-1/+2
| |
* | Fixing Windows asset tag helper test failureRalph Shnelvar2012-02-251-1/+1
|/ | | | | | | | | | | | In asset_tag_helper_test.rb there is an assert on the number of bytes in a concatenated file. This test failed because Windows converts \n to \r\n as the default for "w". This is different than in *nix systems where there is no conversion done. THe test that failed was test_caching_stylesheet_link_tag_when_caching_on Using bin mode fixes this behavior on windows and makes no change on the *nix systems.
* Update Time#change docs to reflect the options it usesEric Oestrich2012-02-181-1/+1
| | | | [ci skip]
* GH #4883. Optional start_day argument for Time#all_weekkennyj2012-02-051-3/+3
|
* Merge pull request #4673 from carlosantoniodasilva/validation-guides-update-3-2Vijay Dev2012-01-251-2/+2
|\ | | | | Validation guides update 3 2
| * Change ActiveRecord::Errors to ActiveModel::Errors in guidesCarlos Antonio da Silva2012-01-251-2/+2
| | | | | | | | | | | | | | Use ActiveModel::Errors in inflection example docs as well. Also fixes wrong information and link to locale file related to Errors#full_messages in I18n guide.
* | Merge pull request #4514 from brainopia/update_timezone_offetsAaron Patterson2012-01-241-1/+1
|/ | | | Update time zone offset information
* Pass a symbol instead of a block. This is faster and more concise.Semyon Perepelitsa2012-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least Ruby 1.8.7 is required which is ok since 3.2. Benchmark: ```ruby require "benchmark" enum = 1..10_000 N = 100 Benchmark.bm do |x| x.report "inject block" do N.times do enum.inject { |sum, n| sum + n } end end x.report "inject symbol" do N.times do enum.inject(:+) end end end ``` Result: ``` user system total real inject block 0.160000 0.000000 0.160000 ( 0.179723) inject symbol 0.090000 0.000000 0.090000 ( 0.095667) ```
* fixes in api docsVijay Dev2012-01-131-1/+1
|
* Merge pull request #4283 from lest/fix-singleton-checkingAaron Patterson2012-01-031-1/+1
| | | | use correct variant of checking whether class is a singleton