| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
cpruitt/revert-36690-make-parameterize-requires-utf-8-explicit
Revert "Make UTF-8 string requirement explicit for `ActiveSupport::Inflector.transliterate`"
|
|/
|
|
| |
`ActiveSupport::Inflector.transliterate`"
|
|\
| |
| | |
Make UTF-8 string requirement explicit for `ActiveSupport::Inflector.transliterate`
|
| |
| |
| |
| |
| |
| | |
It's noted in #34062 that String#parameterize will raise an `Encoding::CompatibilityError` if the string is not UTF-8 encoded. The error is raised as a result of passing the string to `.unicode_normalize`.
This PR raises a higher level `ArgumentError` if the provided string is not UTF-8 and updates documentation to note the encoding requirement.
|
|\ \
| | |
| | | |
Support beginless ranges in hash conditions.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
Ruby 2.7 introduces beginless ranges (..value and ...value) and as with
endless ranges we can turn these into inequalities, enabling expressions
such as
Order.where(created_at: ..1.year.ago)
User.where(karma: ...0)
|
|\ \
| | |
| | |
| | |
| | | |
abhaynikam/36332-fix-engine-documentation-to-remove-js-directory-mention
Fixed the engine documentation to not mention of assets/javascript in directory structure [ci skip]
|
| | |
| | |
| | |
| | | |
directory structure [ci skip]
|
|\ \ \
| | | |
| | | | |
[ActiveRecord] Superclass for aborted queries
|
|/ / / |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Raise specific exception on Mysql2::Error::TimeoutError
|
| | | | |
|
|\ \ \ \
| |_|_|/
|/| | | |
Update message verifier documentation [ci skip]
|
| | | |
| | | |
| | | | |
Generate method of ActiveSupport Message verifier implied that the message is encrypted, but the message is simply Base64-encoded.
|
|\ \ \ \
| |_|/ /
|/| | |
| | | |
| | | | |
gmcgibbon/clarify_logger_set_in_log_subscriber_docs
Specify log subscribers need a logger set before they can receive events
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The current example code for `ActiveSupport::LogSubscriber` mysteriously
fails if you're using it outside of Rails. This helps clarify a logger
needs to be set first before log subscribers can process events.
[ci skip]
|
|\ \ \ \
| | | | |
| | | | | |
Fix Loadable.exclude_from to also reset Kernel#require
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Move the `ActiveModel:Errors#full_message` method to the `Error` class:
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Since `ActiveModel::Error` can now be inherited by
`ActiveModel::NestedError`, when the latter generates a
`full_message`, the `i18n_customize_full_message` accessor set in
the parent class is not set.
This commit fixes that by using a `class_attribute` instead.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- One regression introduced by the "AM errors as object" features is
about the `full_messages` method.
It's currently impossible to call that method if the `base` object
passed in the constructor of `AM::Errors` doesn't respond to the
`errors` method.
That's because `full_messages` now makes a weird back and forth trip
`AM::Errors#full_messages` -> `AM::Error#full_message` -> `AM::Errors#full_message`
Since `full_message` (singular) isn't needed by AM::Errors, I moved
it to the `AM::Error` (singular) class. This way we don't need to
grab the `AM::Errors` object from the base.
|
| | | | | | |
|
| | | | | | |
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | |
| | | | | | |
Reduce log noise handling ActionController::RoutingErrors
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Each time a missing route is hit 32 lines of internal rails traces
are written to the log. This is overly verbose and doesn't offer
any actionable information to the user.
With this change we'll still write an error message showing the
route error but the trace will be omitted.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
sikachu/fix-source-annotation-extractor-annotation
Fix problem with accessing deprecated constant proxy's subclass
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This commit fixes #36313.
After #32065 moved `SourceAnnotationExtractor` into `Rails` module, it
broke the ability to access `SourceAnnotationExtractor::Annotate`
directly as user would get this error:
TypeError: Rails::SourceAnnotationExtractor is not a class/module
This commit fixes the issue by making `DeprecatedConstantProxy` to
inherit from `Module` and then defines `method_missing` and
`const_missing` to retain the previous functionality.
Thank you Matthew Draper for the idea of how to fix the issue!
[Prem Sichanugrist & Matthew Draper]
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Add hash method to ActionController::Parameters
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
wjessop/change_activestorage_metadata_duration_to_bound
Different versions of ffprobe can return subtly different video lengths
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Specify a range so we can take this into account, but not get caught out by 0, nil or way too large values.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Return a copy of the cache entry when local_cache exists:
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
- When the local cache exists (during the request lifecycle), the
entry returned from the LocalStore is passed as a reference which
means mutable object can accidentaly get modified.
This behaviour seems unnecessarily unsafe and is prone to
issues like it happened in our application.
This patch dup the `Entry` returned from the cache and dup it's
internal value.
|
| | | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Returns `nil` when `AM::Errors#delete` doesn't delete anything:
|
| |/ / / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
- `AM::Errors#delete` currently returns an empty array when trying
to delete an error that doesn't exist.
This behaviour is surprising and I think it would be better
to no return a truthy value but instead return nil like
`Hash#delete` does.
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Fix `AM::Errors.added?` trying to generate a message:
|
| |/ / / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
- When a ActiveRecord record get saved and validated as part of a
collection association, the errors attribute are changed to reflect
the children names. You end up with an error attribute that will
look like this:
`author.errors # {:'books.title' => [:blank]}`
https://github.com/rails/rails/blob/2fe20cb55c76e6e50ec3a4ec5b03bbb65adba290/activerecord/lib/active_record/autosave_association.rb#L331-L340
We then can't check if the `books.title` errors was added using
`ActiveModel::Errors#added?` because it tries to generate a message
to make the match and end up calling the "books.title" method
on the Author.
```
author.errors.added?(:'books.title', :blank) => NoMethodError: undefined method `books.title'
```
This patch modify the behaviour of `strict_match?` to not generate
a message to make the comparison but instead make a strict
comparison with the `options` from the error.
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Fix errors getting duplicated when passed validations options:
|
| |/ / / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
- In 86620cc3aa8e2630bc8d934b1a86453276b9eee9, a change was made
on how we remove error duplication on a record for autosave
association
This fix has one caveat where validation having a `if` / `unless`
options passed as a proc would be considered different.
Example:
```ruby
class Book < ApplicationRecord
has_one :author
validates :title, presence: true, if -> { true }
validates :title, presence: true, if -> { true }
end
Book.new.valid? # false
Book.errors.full_messages # ["title can't be blank", "title can't be blank"]
```
While this example might sound strange, I think it's better to
ignore `AM::Validations` options (if, unless ...) when making the
comparison.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
In older Ruby, nil, Symbol, Fixnum, Rational, and Complex were not
duplicable. In Ruby 2.5, all of them are duplicable.
|
|\ \ \ \ \ \ \ \ \ \
| |_|_|_|_|_|_|/ / /
|/| | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
soartec-lab/fix/update_guide_active_support_not_mention_old_ruby
Delete mention of Ruby 1.9 [skip ci]
|
| | |_|_|_|_|/ / /
| |/| | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Empty array instead of nil for source_extract
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
The source_extract method will return nil when it can't find the file name in
the backtrace, methods that consume this method expect an array and the nil ends
up causing type errors down the road like it happened here: #36341. This
patch refactors the source_extract method so that it returns an empty
array instead of nil when it can't find the source code.
Co-authored-by: Kasper Timm Hansen <kaspth@gmail.com>
|
| |/ / / / / / / /
|/| | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This is the only use of it
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Prevent exception of loading database yaml with blank config file
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
#36661]
|
|\ \ \ \ \ \ \ \ \ \
| |_|_|_|/ / / / / /
|/| | | | | | | | | |
Use reserved domain for example configuration
|