| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
reuse available collection? check instead of macro
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Reflection has an available method that is used to check if the
reflection is a collection. Any :has_many macro is considered a
collection and `collection?` should be used instead of
`macro == :has_many`.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
add has_one? method and reuse instead of checking macro
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Instead of checking for `macro == :has_one` throughout the
codebase we can create a `has_one?` method to match the `belongs_to?`,
`polymorphic?` and other methods.
|
|\ \ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
Abstract away use of HABTM macro
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
By having the `:has_and_belongs_to_many` macro in the `@collection`
we are punishing `:has_many` associations because it has to allocate
the array and check the macro.
@collection is returned to `macro == :has_many` and a new reflection
class `HABTMReflection` is created to handle this case instead.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Before HashWithIndifferentAccess were doing deep_dup of the inner hashes
when Hash doesn't do. Now both are behaving in the same way.
|
| |/ / / / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This reverts commit dd3ea17191e316aeebddaa7b176f6cfeee7a6365 and add a
regression test.
Fixes #15418
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | | |
Rename `type_cast` to `type_cast_from_database`
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In some cases there is a difference between the two, we should always
be doing one or the other. For convenience, `type_cast` is still a
private method on type, so new types that do not need different behavior
don't need to implement two methods, but it has been moved to private so
it cannot be used accidentally.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Use an actual identity type in AR::Result#identity_type
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | | |
We should be able to rely on this object implenting the full type
interface.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Remove workaround for non-lazy serialize in tests
|
| | |_|/ /
| |/| | |
| | | | |
| | | | | |
`serialize` is now lazy, so the workaround is no longer needed.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Make `_before_type_cast` actually be before type cast
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- The following is now true for all types, all the time
- `model.attribute_before_type_cast == given_value`
- `model.attribute == model.save_and_reload.attribute`
- `model.attribute == model.dup.attribute`
- `model.attribute == YAML.load(YAML.dump(model)).attribute`
- Removes the remaining types implementing `type_cast_for_write`
- Simplifies the implementation of time zone aware attributes
- Brings tz aware attributes closer to being implemented as an attribute
decorator
- Adds additional point of control for custom types
|
| |_|/ /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Integration tests are inside protected_attributes test suite.
Fixes #15496
Fixes rails/protected_attributes#35
|
|\ \ \ \
| |/ / /
|/| | | |
Remove a long gone :order option from has_one's valid_options
|
|/ / / |
|
|/ / |
|
|\ \
| | |
| | | |
Mail 2.6.1 silences excessive warnings; remove Gemfile hack
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
Completes https://github.com/rails/rails/pull/15493
Revert "For our build, stick with mail 2.5.x for now"
This reverts commit b8f586a094c104006d29a87fee0d8b48d0af2d14.
|
|\ \
| | |
| | | |
Update migrations.md
|
|/ /
| |
| | |
default column type modifier
|
| |
| |
| |
| |
| |
| |
| | |
Not sure what's causing them suddenly, but it seems unlikely there's
much we can do about it. For the small amount of coverage this
particular job gains us, it's hurting us more, by making CI failures
unremarkable.
|
|\ \
| | |
| | | |
Restore test deliveries for ActionMailer.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Handle client disconnect during live streaming
|
| | | |
| | | |
| | | |
| | | | |
.. even when the producer is blocked for a write.
|
|\ \ \ \
| | | | |
| | | | | |
Add Additional Test Cases for the constantize
|
| |/ / / |
|
|\ \ \ \
| | | | |
| | | | | |
fix test cases after #15558 merge to master.
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Rename `property` to `attribute`
Conflicts:
activerecord/lib/active_record/attribute_methods/serialization.rb
activerecord/lib/active_record/base.rb
|
| | | | |
| | | | |
| | | | |
| | | | | |
For consistency with https://github.com/rails/rails/pull/15557
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Don't query the database schema when calling `serialize`
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | | |
We need to decorate the types lazily. This is extracted to a separate
API, as there are other refactorings that will be able to make use of
it, and to allow unit testing the finer points more granularly.
|
|\ \ \ \
| | | | |
| | | | | |
Ensure time zones don't change after round trip with array columns
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The times would be equivalent, even if they were in different time
zones. E.g. 12:00 UTC == 5:00 PDT
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Do not type cast twice on attribute assignment
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The definition of `write_attribute` in dirty checking ultimately leads
to the columns calling `type_cast` on the value to perform the
comparison. However, this is a potentially expensive computation that we
cache when it occurs in `read_attribute`. The only case that we need the
non-type-cast form is for numeric, so we pass that through as well
(something I'm looking to remove in the future).
This also reduces the number of places that manually access various
stages in an attribute's type casting lifecycle, which will aid in one
of the larger refactorings that I'm working on.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Correct Example output in Rails guides [ci skip]
|
| | |_|/ /
| |/| | | |
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Remove dead branch when restoring ID within a transaction
Conflicts:
activerecord/lib/active_record/transactions.rb
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
There is no way to have an instance of an Active Record model where
`has_attribute?(self.class.primary_key)` returns false. The record is
always initialized in such a way that `@raw_attributes` will have an id
key with nil for the value.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Move conditionals about freezing closer to the definition of `freeze`
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Reduces the number of places that care about the internals of how we
store and type cast attributes. We do not need to go through the
dup/freeze dance, as you couldn't have saved a frozen new record anyway,
and that is the only time we would end up modifying the frozen hash.
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Remove duplicated `@raw_attributes.keys`
|
|/ / / /
| | | |
| | | |
| | | |
| | | | |
Reduces the number of things outside of attribute methods that cares
about the details of how we store and type cast attributes
|
|\ \ \ \
| | | | |
| | | | | |
Specify a time zone when testing TZ aware attributes
|