| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Keep previous state around for nested calls to #suppress
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | |
| | | |
Fix bug in JSON deserialization when column default is an empty string
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Rails 5.1 point type should not raise exception if empty string is provided as input
|
| | | |
| | | |
| | | |
| | | | |
as value
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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`.
|
|\ \ \ \
| |/ / /
|/| | | |
Add some assertions for BigDecimal#to_s
|
| | | | |
|
|/ / / |
|
| | |
| | |
| | |
| | | |
Conventionally envs are ordered development -> test -> production.
|
|\ \ \
| | | |
| | | | |
Add Action Cable guide to list
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | | |
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]
|
| | | |
|
|\ \ \
| | | |
| | | | |
Document and test ActionDispatch server_port
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
Conflicts:
guides/source/configuring.md
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
ActionController::Metal.ancestors` command for api apps.
[ci skip]
|
| | | | |
| | | | |
| | | | |
| | | | | |
vs configuring the server itself
|
| | | | |
| | | | |
| | | | |
| | | | | |
config.action_dispatch.x_sendfile_header in configuring guide
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
was needed before. [ci skip]
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
option
[ci skip]
|
| | | | |
| | | | |
| | | | |
| | | | | |
[ci skip]
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
[ci skip]
|
| | | | |
| | | | |
| | | | |
| | | | | |
human readable form [ci skip]
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
level why we are doing this.
[ci skip]
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Perfomance fix for ActiveSupport Enumerable#index_by
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Add missing space and newline for clarity
|
| | |_|/ /
| |/| | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Add notes on cosmetic patches to contributing guidelines
|
|/ / / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| | | | |
| | | | | |
Rename test method
|
|/ / / / |
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | | |
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
|
|\ \ \
| | | |
| | | | |
Define ActiveRecord::Attribute::Null#type_cast
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| | | | |
| | | | | |
Improve documentation and tests for raw_host_with_port and host_with_…
|
| | | | | |
|
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | | |
When calling remove_connection in a subclass, that should not fallback
to the parent, otherwise it will remove the parent connection from the
handler.
|
|\ \ \ \
| | | | |
| | | | | |
Getting Started Guide: Add invoke test_unit to files table [ci skip]
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Added clarity to documentation of ArrayInquirer#any? [ci skip]
|