| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| |/ /
| | |
| | |
| | | |
Millisecond inequality causes failures on Travis
|
|/ /
| |
| |
| |
| |
| | |
This is a follow up to #15556
@kuldeepaggarwal did submit this patch way back (#13624).
|
|\ \
| | |
| | | |
Add array support when time zone aware attributes are enabled
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
This is a regression test for 29844dd.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We cannot cache keys because arrays are mutable. We rather want to cache
the arrays. This behaviour is tailor-made for the usage pattern strongs
params is designed for.
In a forthcoming commit I am going to add a test that covers why we need
to cache by value.
Every strong params instance has a live span of a request, the cache goes
away with the object. Since strong params have such a concrete intention,
it would be interesting to see if there are actually any real-world use
cases that are an actual leak, one that practically may matter.
I am not convinced that the theoretical leak has any practical consequences,
but if it can be shown there are, then I believe we should either get rid of
the cache (which is an optimization), or else wipe it in the mutating API.
This reverts commit e63be2769c039e4e9ada523a8497ce3206cc8a9b.
|
| | | |
|
|\ \ \ |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
When you manually specify `id:` attribute in a fixture Rails' built in association assignment feature will no longer work. http://stackoverflow.com/questions/23985675/incorrect-association-in-fixtures
This commit raises awareness of this behavior and encourages developers to look directly at the fixture documentation.
|
| | | |
| | | |
| | | | |
The fixtures API docs are really comprehensive. We should either be driving people there, or perhaps making fixtures its own guide.
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix capitalization
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
remove rubyforge.org that was shut down [ci skip]
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
/cc @tenderlove
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
Removed unused `klass` definitions from types
|
|/ / / /
| | | |
| | | |
| | | | |
Only `Date` and `Time` are handled.
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Remove composed_of special case from multi-parameter attributes
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As we move towards removing the `klass` method from `column`, the else
clause as it stands right now will become the only case.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Don't mess with `_before_type_cast` for numeric types
|
| |/ / / / |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This reverts commit be1db9946616a4005bb7be45656cc0f84d75d915, reversing
changes made to 6680ee9427ae2639e404cd3b9538f54e136057c6.
Reason: This changed a behavior where numeric attributes when receiving
blank values didn't change its value.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Don't mess with `_before_type_cast` for numeric types
|
|/ / / / |
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | | |
zuhao/refactor_actionmailer_i18n_with_controller_test
Restore I18n.locale to default after test.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If i18n_with_controller_test.rb were to run first, the I18n.locale will
be changed to :de, and the following tests in base_test.rb will fail:
"subject gets default from I18n"
“default subject can have interpolations”
"translations are scoped properly"
"implicit multipart with default locale"
|
|\ \ \
| |_|/
|/| | |
Restore test deliveries properly in ActionMailer.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`ActionMailer::Base.delivery_method` and
`ActionMailer::Base.perform_deliveries` have leaked states.
"delivery method can be customized per instance" and "delivery method
can be customized in subclasses not changing the parent" in
delivery_methods_test.rb will fail if test_helper_test.rb (in which
TestHelperMailerTest is inherited from ActionMailer::TestCase) runs
before it.
|
|\ \
| | |
| | | |
Add missing test cases for schema dumping defaults
|
| | | |
|
| | |
| | |
| | |
| | | |
[ci skip]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Before this patch, using `ActiveRecord::Base.primary_key_prefix_type`
with `:table_name_with_underscore` would change the `SchemaMigration` model
to have a primary key. This resulted in broken queries for PG because it tried
to return the inserted PK (which does not exist).
Closes #15051.
Closes #15419.
|
| | | |
|