| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- `AM::Error#to_h` was kind of broken before and would return in the
hash values a single error message.
```ruby
person = Person.new
person.errors.add(:name, "cannot be blank")
person.errors.add(:name, "too long")
puts person.errors.to_h # {name: 'too long'}
```
Since an attribute can have different errors, the previous behavior
didn't make much sense.
Now, `ActiveModel::Errors#to_hash` correctly returns an array of
error messages containing all the errors for an attribute.
However, one can easily be surprised by this change, so let's
deprecated it first.
|
|\
| |
| | |
Fix cache_timestamp_format default value in guides
|
| | |
|
|\ \
| | |
| | | |
Deprecate `AM::Errors#to_h`:
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- In ef4d3215b1198c456780b8d18aa62be7795b9b8c I made a change to
pass `AM::Error` object in case the arity of the block passed to
`each` accepted less than 2 arguments.
This is causing one issue for `to_h` as it expects the argument
passed to the block to be an Array (and were are passing it an
instance of `AM::Error`).
There is no real reason to use `to_h` anymore since `to_hash` exists
Deprecating `to_h` inf favor of `to_hash`
Co-Authored-By: Rafael França <rafael@franca.dev>
|
| | |
|
|\ \
| | |
| | | |
Make Active Storage routes optional
|
|/ /
| |
| |
| | |
Add configuration option to turn off drawing of Active Storage routes.
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
Edouard-chin/ec-source-annotation-extractor-deprecation
Move the deprecation call after the new class has been defined:
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- If we create the deprecation before the new class is defined this
creates an issue in case you use a `TracePoint`. The
`Tracepoint#return_value` will try to get the new class constant
resulting in a uninitialized constant Rails::SourceAnnotationExtractor
The problem can be reproduced like this:
```ruby
@defined = Set.new
ANONYMOUS_CLASS_DEFINITION_TRACEPOINT = TracePoint.new(:c_return) do |tp|
next unless @defined.add?(tp.return_value)
end
ANONYMOUS_CLASS_DEFINITION_TRACEPOINT.enable
require 'rails'
require "rails/source_annotation_extractor"
```
|
|\ \
| |/
|/|
| |
| | |
alipman88/exclude_marshal_dump_from_delegate_missing_to
Exclude marshal_dump & _dump methods from being delegated via delegate_missing_to extension, fix #36522
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Exclude missing marshal_dump and _dump methods from being delegated to
an object's delegation target via the delegate_missing_to extension.
This avoids unintentionally adding instance variables to an object
during marshallization, should the delegation target be a method which
would otherwise add them.
In current versions of Ruby, a bug exists in the way objects are
marshalled, allowing for instance variables to be added or removed
during marshallization (see https://bugs.ruby-lang.org/issues/15968).
This results in a corrupted serialized byte stream, causing an object's
instance variables to "leak" into subsequent serialized objects during
demarshallization.
In Rails, this behavior may be triggered when marshalling an object that
uses the delegate_missing_to extension, if the delegation target is a
method which adds or removes instance variables to an object being
marshalled - when calling Marshal.dump(object), Ruby's built in behavior
will check whether the object responds to :marshal_dump or :_dump, which
in turn triggers the delegation target method in the
responds_to_missing? function defined in
activesupport/lib/active_support/core_ext/module/delegation.rb
While future versions of Ruby will resolve this bug by raising a
RuntimeError, the underlying cause of this error may not be readily
apparent when encountered by Rails developers. By excluding marshal_dump
and _dump from being delegated to an object's target, this commit
eliminates a potential cause of unexpected behavior and/or
RuntimeErrors.
Fixes #36522
|
|\ \
| | |
| | |
| | |
| | | |
masakazutakewaka/fix_create_newline_between_blocks
FIX: create a newline before group, github and source
|
|/ /
| |
| |
| | |
called.
|
|\ \
| | |
| | | |
Fix deprecation on `AM::Errors` when each is called indirectly
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- `AM::Errors#each` is implemented for the `Enumerator` module and
get called indirectly by a bunch of method in the ruby land
(map, first, select ...)
These methods have a `-1` arity as they are written in C and they
wrongly trigger a deprecation warning.
This commit fixes that and correctectly return a `AM::Error` object
when `each` is called with a negative arity.
|
|\ \ \
| |/ /
|/| |
| | |
| | | |
masakazutakewaka/fix_railtie_add_newline_to_gemfile_insertion
Add a newline at the end of a Gemfile when it doesn't end with a newline
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Assigning to a collection of attachments appends rather than replacing, as in 5.2. Existing 5.2 apps that rely on this behavior will no longer break when they're upgraded to 6.0.
For apps generated on 6.0 or newer, assigning replaces the existing attachments in the collection. #attach should be used to add new attachments to the collection without removing existing ones.
I expect that we'll deprecate the old behavior in 6.1.
Closes #36374.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Helper method to create an sms link
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
phone/desktop's messaging client with the phone number and optional body value prepopulated.
|
|\ \ \ \
| | | | |
| | | | | |
Fix a minor typo in ActionView::UnboundTemplate
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
[ActiveRecord] Deduplicate optimizer hints
|
| | | | | | |
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | | |
Include common commands in rails help output
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
With their descriptions commented out these commands were not included
in the rails help command's output, which is a shame as they are useful,
particularly during the development of more complex migrations.
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
[ActionController] Fix send_file example for 404
[ci skip]
|
|/ / / / / |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Add support for script-src-attr / elem and style-src-attr / elem directives
|
| | |_|/
| |/| |
| | | |
| | | |
| | | | |
These directives can be used in Chrome 75.
Ref: https://www.chromestatus.com/feature/5141352765456384
|
|\ \ \ \
| |/ / /
|/| | | |
Revert "Merge pull request #36676 from wjessop/change_activestorage_metadata_duration_to_bound"
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
wjessop/change_activestorage_metadata_duration_to_bound"
This reverts commit a307c697b28e3c8b2860d2274c23e4d95dc164ae, reversing
changes made to f30f76af747858826d3618866676cd5a4979e64a.
Reason: This assertion is not failed even without this PR since both
ffprobe versions (3.2.14 and 4.1.3) return the same duration 5.166648
for `video.mp4`.
So there is no need to touch this assertion at this point.
|
|\ \ \ \
| | | | |
| | | | | |
Add `skip-collision-check` option to generator
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Until Rails 5.2, generators can run same name multi times without destroying.
But Rails 6.0(with Zeitwerk) can't this. In Rails 6.0, an error occurs
due to class name collision check.
The check uses `const_defined?`, which assumes that the autoload object
is also defined.
https://ruby-doc.org/core-2.6.3/Module.html#method-i-const_defined-3F
It did not work until Rails 5.2, but Zeitwerk seems to be able to
correctly check this against the application's code.
However, this is a little inconvenient if want to run the generator
again like mistake an attribute name(need to run `destoy` before).
In order to solve this, this PR adds an option to skip the collision check.
With this option, you can overwrite files just as did until Rails 5.2.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Don't include routes helpers inside System test class:
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- https://github.com/rails/rails/pull/36283 made a change to
make SystemTest inherits from ActiveSupport::TestCase instead
of ActionDispatch::IntegrationTest.
With this change, the route helpers are now directly included inside
the SystemTest class. This causes an edge case in case you have a
routes whos name starts with `test_`, minitest will consider it as a
test and will try to run it https://github.com/seattlerb/minitest/blob/ab39d35fb4e84eb866ed9c4ecb707cbf3889de42/lib/minitest/test.rb#L66
This PR uses a proxy and deleted missing method to a dummy class
that has all the route helpers.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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
|
|/ / / / / / / |
|