| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
Avoid duplicated `set_inverse_instance` for target scope
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Because `scope` (`target_scope`) is a `AssociationRelation`.
`AssociationRelation` handles `set_inverse_instance`.
https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/association_relation.rb#L31-L33
See also #26022.
|
|\ \
| |/
|/| |
Add documentation for ActiveSupport::StringInquirer [ci skip]
|
| | |
|
|\ \
| | |
| | | |
Add retry_on/discard_on for better exception handling
|
| | | |
|
| | | |
|
| |\ \ |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Let’s do it when we actually execute instead. Then the tests dealing
with comparable serializations won’t fail either!
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Remove unnecessary `set_inverse_instance` in finder methods
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | | |
Because `scope` (`target_scope`) is a `AssociationRelation`.
`AssociationRelation` handles `set_inverse_instance`.
https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/association_relation.rb#L31-L33
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | | |
Some Rails core members agreed to continue to maintain 4.2 until 5.1 is
released.
[ci skip]
|
| | | |
|
| | | |
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | | |
That file has been removed and replaced with new_framework_defaults.rb
|
| | | |
| | | |
| | | |
| | | | |
- Followup of https://github.com/rails/rails/pull/23179.
|
| | | |
| | | |
| | | |
| | | | |
`_key_[]` [ci skip]
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
guides [ci skip]
- Followup of #25692.
|
| | | |
| | | |
| | | |
| | | | |
Screwed up both the left and right hand sides!
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The tests were written with the common false value seen in Rails apps,
show that intent in the code.
Should also fix the build on 5-0-stable.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Looked odd, so completely detached from the other necessary part of
the implementation.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The coder that Psych passes in has a `tag` method we can use to detect
which serialization format we're reviving for. Use it and make it clearer
alongside the `load_tags` fiddling.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If we were to serialize an `ActionController::Parameters` on Psych 2.0.8, we'd get:
```yaml
--- !ruby/hash:ActionController::Parameters
key: :value
```
Because 2.0.8 didn't store instance variables, while 2.0.9 did:
https://github.com/tenderlove/psych/commit/8f84ad0fc711a82a1040def861cb121e8985fd4c
That, coupled with 2.0.8 calling `new` instead of `allocate` meant parameters was
deserialized just fine:
https://github.com/tenderlove/psych/commit/af308f8307899cb9e1c0fffea4bce3110a1c3926
However, if users have 2.0.8 serialized parameters, then upgrade to Psych 2.0.9+ and
Rails 5, it would start to blow up because `initialize` will never be called, and thus
`@parameters` will never be assigned. Hello, `NoMethodErrors` on `NilClass`! :)
To fix this we register another variant of the previous serialization format and take
it into account in `init_with`.
I've tested this in our app and previously raising code now deserializes like a champ.
I'm unsure how to test this in our suite because we use Psych 2.0.8 and don't know how
to make us use 2.0.9+ for just one test.
|
|\ \ \ \
| |_|/ /
|/| | |
| | | |
| | | | |
kaspth/parameters-yaml-format-backwardscompatibility
Make Parameters support legacy YAML encodings.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
By changing ActionController::Parameter's superclass, Rails 5 also changed
the YAML serialization format.
Since YAML doesn't know how to handle parameters it would fallback to its
routine for the superclass, which in Rails 4.2 was Hash while just Object
in Rails 5. As evident in the tags YAML would spit out:
4.2: !ruby/hash-with-ivars:ActionController::Parameters
5.0: !ruby/object:ActionController::Parameters
Thus when loading parameters YAML from 4.2 in Rails 5, it would parse a
hash dump as it would an Object class.
To fix this we have to provide our own `init_with` to be aware of the past
format as well as the new one. Then we add a `load_tags` mapping, such that
when the YAML parser sees `!ruby/hash-with-ivars:ActionController::Parameters`,
it knows to call our `init_with` function and not try to instantiate it as
a normal hash subclass.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
kamipo/remove_unnecessary_methods_for_null_relation
Remove unnecessary methods for `NullRelation`
|
| | |/
| |/| |
|
|\ \ \
| | | |
| | | | |
remove unnecessary require and extend
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`rack/test` is require at the top of file.
https://github.com/rails/rails/blob/master/railties/test/railties/engine_test.rb#L3
In addtion, `Rack::Test::Methods` is include in class, extend is unnecessary.
https://github.com/rails/rails/blob/master/railties/test/railties/engine_test.rb#L9
|
|\ \ \ \
| | | | |
| | | | | |
Suppress warnings
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit suppressed
`warning: instance variable @session_store not initialized`.
e5a6f7ee9e951dbe0e4e9ea2c0743b4dfb135c57 introduced these
warnings.
|
|\ \ \ \
| |/ / /
|/| | | |
remove old links from debugging guide [ci skip]
|
|/ / / |
|
|\ \ \
| |/ /
|/| | |
Revert "Adds `not_in?` onto Object"
|