aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | Merge pull request #24203 from sferik/count_with_blockKasper Timm Hansen2016-05-165-6/+28
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Forward ActiveRecord::Relation#count to Enumerable#count if block given
| * | | | | | | Forward ActiveRecord::Relation#count to Enumerable#count if block givenErik Michaels-Ober2016-03-195-6/+28
| | | | | | | |
* | | | | | | | Merge pull request #24930 from henrik/date-all-daySean Griffin2016-05-163-5/+22
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Introduce Date#all_day
| * | | | | | | | Introduce Date#all_dayHenrik Nyh2016-05-113-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Useful for queries like: Item.where(created_at: Date.current.all_day) There was already a Time#all_day with the same behaviour, but for queries like the above, Date is more convenient.
* | | | | | | | | Merge pull request #25009 from jahfer/suppressor-keep-stateSean Griffin2016-05-162-1/+14
|\ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / |/| | | | | | | | Keep previous state around for nested calls to #suppress
| * | | | | | | | Keep state around for nested calls to #suppressJahfer Husain2016-05-162-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a call to #suppress from the same class occurred inside another #suppress block, the suppression state would be set to false before the outer block completes. This change keeps the previous state around in memory and unwinds it as the blocks exit.
* | | | | | | | | Merge pull request #23810 from xijo/fix_json_coder_when_mysql_strict_is_disabledSean Griffin2016-05-163-1/+20
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix bug in JSON deserialization when column default is an empty string
| * | | | | | | | | Fix bug in JSON deserialization when column default is an empty stringJohannes Opper2016-02-223-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `ActiveRecord::Coders::JSON` serialization is used and the default of the column returns `''` it raises the following error: ``` JSON::ParserError: A JSON text must at least contain two octets! ``` If MySQL is running in non-strict mode, it returns an empty string as column default for a text column: ```ruby def extract_default if blob_or_text_column? @default = null || strict ? nil : '' end end ``` Since `''` is invalid JSON, there shouldn't be an attempt to parse it, it should be treated like nil. ActiveRecord::Coders::JSON should behave consistently for all possible non-user-set column default values.
* | | | | | | | | | Merge pull request #25023 from slbug/patch-1Sean Griffin2016-05-162-0/+9
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Rails 5.1 point type should not raise exception if empty string is provided as input
| * | | | | | | | | | Rails 5.1 point type should not raise exception if empty string is provided ↵bUg2016-05-152-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as value
* | | | | | | | | | | Action Mailer: Declarative exception handling with `rescue_from`.Jeremy Daer2016-05-1513-123/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follows the same pattern as controllers and jobs. Exceptions raised in delivery jobs (enqueued by `#deliver_later`) are also delegated to the mailer's rescue_from handlers, so you can handle the DeserializationError raised by delivery jobs: ```ruby class MyMailer < ApplicationMailer rescue_from ActiveJob::DeserializationError do … end ``` ActiveSupport::Rescuable polish: * Add the `rescue_with_handler` class method so exceptions may be handled at the class level without requiring an instance. * Rationalize `exception.cause` handling. If no handler matches the exception, fall back to the handler that matches its cause. * Handle exceptions raised elsewhere. Pass `object: …` to execute the `rescue_from` handler (e.g. a method call or a block to instance_exec) against a different object. Defaults to `self`.
* | | | | | | | | | | Merge pull request #25022 from ysksn/masterRafael França2016-05-152-4/+4
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | | Add some assertions for BigDecimal#to_s
| * | | | | | | | | | Remove unnecessary constantYosuke Kabuto2016-05-151-4/+2
| | | | | | | | | | |
| * | | | | | | | | | Add some assertions for BigDecimal#to_sYosuke Kabuto2016-05-151-0/+2
|/ / / / / / / / / /
* | | | | | | | | | reorder env keys in the generated config/cable.ymlXavier Noria2016-05-151-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conventionally envs are ordered development -> test -> production.
* | | | | | | | | | Merge pull request #25002 from maclover7/jm-add-actioncable-guideXavier Noria2016-05-141-0/+4
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Add Action Cable guide to list
| * | | | | | | | | | Add Action Cable guide to listJon Moss2016-05-131-0/+4
| | |/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This effectively publishes the "Action Cable Overview" guide. If we don't think this is ready for the prime time, we can mark it as a "work in progress" guide. [ci skip]
* | | | | | | | | | edit pass over the cable guide [ci skip]Xavier Noria2016-05-141-143/+181
| | | | | | | | | |
* | | | | | | | | | Merge pull request #24992 from tomkadwill/test_and_comment_server_port_rebasedEileen M. Uchitelle2016-05-142-0/+22
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Document and test ActionDispatch server_port
| * | | | | | | | | | Document and test ActionDispatch server_portTom Kadwill2016-05-122-0/+22
| | | | | | | | | | |
* | | | | | | | | | | Merge branch 'master' of github.com:rails/docrailsVijay Dev2016-05-147-53/+72
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: guides/source/configuring.md
| * | | | | | | | | | | Add output snippet from `ActionController::API.ancestors - ↵Vipul A M2016-05-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActionController::Metal.ancestors` command for api apps. [ci skip]
| * | | | | | | | | | | Remove ambiquity in what we are referring to in the documentation of config ↵Vipul A M2016-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vs configuring the server itself
| * | | | | | | | | | | Document config.action_dispatch.ignore_accept_header and ↵Vipul A M2016-05-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | config.action_dispatch.x_sendfile_header in configuring guide
| * | | | | | | | | | | More missing true literal quotingsVipul A M2016-05-111-12/+12
| | | | | | | | | | | |
| * | | | | | | | | | | Lets be consistent in the usage of true/false across this guide. It should ↵Vipul A M2016-05-111-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | be quoted as how other config options are. They are already quoted at many places. This change, makes this usage consistent. Note that, this is quoting literal values true and false, not truthy values
| * | | | | | | | | | | Document missing smtp config over at configuring guide. [ci skip]Vipul A M2016-05-111-0/+3
| | | | | | | | | | | |
| * | | | | | | | | | | This config still applies for Rails 4 Apps and we need to mention it, what ↵Vipul A M2016-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | was needed before. [ci skip]
| * | | | | | | | | | | Asset Pipeline: Remove outdated comment about `config.assets.digest` [ci skip]Prathamesh Sonpatki2016-05-081-1/+1
| | | | | | | | | | | |
| * | | | | | | | | | | Asset pipeline: Remove documentation about outdated `config.assets.compress` ↵Prathamesh Sonpatki2016-05-082-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | option [ci skip]
| * | | | | | | | | | | s/words_connnector/words_connector/Vipul A M2016-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
| * | | | | | | | | | | Fix code formatting in docsJay Hayes2016-05-031-2/+2
| | | | | | | | | | | |
| * | | | | | | | | | | Add example for UnknownAttributeErrorVipul A M2016-05-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
| * | | | | | | | | | | Active Model: Messages for strict validation always convert attributes to ↵Prathamesh Sonpatki2016-05-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | human readable form [ci skip]
| * | | | | | | | | | | Move comment up to the class, for both of the methods, and document on class ↵Vipul A M2016-05-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | level why we are doing this. [ci skip]
* | | | | | | | | | | | Merge pull request #25008 from lvl0nax/as_enumarable_index_by_refactoringRafael França2016-05-141-1/+3
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | Perfomance fix for ActiveSupport Enumerable#index_by
| * | | | | | | | | | | | Perfomance fix for Enumerable#index_bylvl0nax2016-05-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calculating ------------------------------------- before 34.731k i/100ms after 48.206k i/100ms ------------------------------------------------- before 508.451k (± 1.2%) i/s - 2.570M after 720.068k (± 0.9%) i/s - 3.615M Comparison: after: 720067.6 i/s before: 508451.1 i/s - 1.42x slower
* | | | | | | | | | | | | Merge pull request #25003 from kangkyu/missing_lineRafael França2016-05-141-3/+3
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / |/| | | | | | | | | | | | Add missing space and newline for clarity
| * | | | | | | | | | | | Add missing space and newline for clarityKang-Kyu Lee2016-05-121-3/+3
| | |_|/ / / / / / / / / | |/| | | | | | | | | |
* | | | | | | | | | | | Merge pull request #25015 from joemasilotti/patch-1Eileen M. Uchitelle2016-05-131-0/+4
|\ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / |/| | | | | | | | | | | Add notes on cosmetic patches to contributing guidelines
| * | | | | | | | | | | Add notes on cosmetic patchesJoe Masilotti2016-05-131-0/+4
|/ / / / / / / / / / /
* | | | | | | | | | | Give more context from `AssociationMismatchError`Sean Griffin2016-05-122-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error message that we give today makes this error difficult to debug if you receive it. I have no clue why we're printing the object ID of the class (the commit doesn't give context), but I've left it as it was deliberate.
* | | | | | | | | | | Merge pull request #25001 from Neodelf/typosRichard Schneeman2016-05-121-1/+1
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Rename test method
| * | | | | | | | | | | Rename test methodMolchanov Andrey2016-05-121-1/+1
|/ / / / / / / / / / /
* | / / / / / / / / / Fix false positive mutation detection when JSON is used with serializeSean Griffin2016-05-122-1/+40
| |/ / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When looking for mutation, we compare the serialized version of the value to the before_type_cast form. `Type::Serialized` was breaking this contract by passing the already serialized attribute to the subtype's mutation detection. This never manifested previously, as all mutable subtypes either didn't do anything in their `serialize` method, or had a way to detect double serialization (e.g. `is_a?(String)`). However, now that JSON types can handle string primitives, we need to avoid double serialization. Fixes #24993.
* | | | | | | | | | Publish Action Cable to NPM when we release.Jon Moss2016-05-114-8/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* | | | | | | | | | Merge pull request #24980 from merhard/virtual-attribute-defaultSean Griffin2016-05-112-1/+10
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Define ActiveRecord::Attribute::Null#type_cast
| * | | | | | | | | | Define ActiveRecord::Attribute::Null#type_castMatthew Erhard2016-05-112-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using ActiveRecord::Base.attribute to declare an attribute with a default value on a model where the attribute is not backed by the database would raise a NotImplementedError when model.save is called. The error originates from https://github.com/rails/rails/blob/59d252196b36f6afaafd231756d69ea21537cf5d/activerecord/lib/active_record/attribute.rb#L84. This is called from https://github.com/rails/rails/blob/59d252196b36f6afaafd231756d69ea21537cf5d/activerecord/lib/active_record/attribute.rb#L46 on an ActiveRecord::Attribute::Null object. This commit corrects the behavior by implementing ActiveRecord::Attribute::Null#type_cast. With ActiveRecord::Attribute::Null#type_cast defined, ActiveRecord::Attribute::Null#value (https://github.com/rails/rails/blob/59d252196b36f6afaafd231756d69ea21537cf5d/activerecord/lib/active_record/attribute.rb#L173..L175) can be replaced with its super method (https://github.com/rails/rails/blob/59d252196b36f6afaafd231756d69ea21537cf5d/activerecord/lib/active_record/attribute.rb#L36..L40). fixes #24979
* | | | | | | | | | | Merge pull request #24982 from tomkadwill/improve_clarity_of_raw_host_with_portKasper Timm Hansen2016-05-112-3/+30
|\ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|/ / / |/| | | | | | | | | | Improve documentation and tests for raw_host_with_port and host_with_…
| * | | | | | | | | | Improve documentation and tests for raw_host_with_port and host_with_portTom Kadwill2016-05-112-3/+30
| | | | | | | | | | |