| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
In order to improve the performance of dirty checking, we're going to
need to duplicate all of the `previous_` methods in Active Model.
However, these methods are basically the same as their non-previous
counterparts, but comparing `@original_attributes` to
`@previous_original_attributes` instead of `@attributes` and
`@original_attributes`. This will help reduce that duplication.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This moves a bit more of the logic required for dirty checking into the
attribute objects. I had hoped to remove the `with_value_from_database`
stuff, but unfortunately just calling `dup` on the attribute objects
isn't enough, since the values might contain deeply nested data
structures. I think this can be cleaned up further.
This makes most dirty checking become lazy, and reduces the number of
object allocations and amount of CPU time when assigning a value. This
opens the door (but doesn't quite finish) to improving the performance
of writes to a place comparable to 4.1
|
|\
| |
| | |
Make `assert_difference` return the result of the yielded block.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With this we can perform new assertions on the returned value without having
to cache it with an outer variable or wrapping all subsequent assertions inside
the `assert_difference` block.
Before:
```
post = nil
assert_difference -> { Post.count }, 1 do
Post.create
end
assert_predicate post, :persisted?
```
Now:
```
post = assert_difference -> { Post.count } do
Post.create
end
assert_predicate post, :persisted?
```
|
|\ \
| | |
| | | |
Fix typo in ignored_columns test [skip ci]
|
|/ /
| |
| |
| | |
Follow-up to #21720.
|
|\ \
| | |
| | | |
Implement ActiveRecord::Base.ignored_columns
|
|/ / |
|
|\ \
| | |
| | |
| | | |
ActiveRecord: use association's `unscope` when preloading
|
| | | |
|
|\ \ \
| |_|/
|/| |
| | | |
Fix a bug with returning_disabled when using the postgresql adapter
|
| | |
| | |
| | |
| | | |
The returning_disabled configuration option is required to make postgresql partitioning triggers work. This commit fixes a bug where an invalid query would be made in cases where returning_disabled was true and objects were created with no attributes defined.
|
|\ \ \
| | | |
| | | | |
Improve readability of docs by using code tag [ci skip]
|
|/ / / |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
[ci skip]
[Action View Overview Guide] Add note about Jbuilder
|
| | | |
| | | |
| | | |
| | | | |
[skip ci]
|
|\ \ \ \
| | | | |
| | | | | |
Fix ActiveRecord `instance_method_already_implemented` docs [ci skip]
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Fix out of sync comment [ci skip]
|
|/ / / /
| | | |
| | | | |
It appears that as of version 4 the `db:test:prepare` task no longer depends on the `abort_if_pending_migrations` task, which leaves this comment out of sync.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
we want the request to go through the test harness, not directly call
the methods on the controller
|
| | | |
| | | |
| | | |
| | | | |
also remove req / res references
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
again, since we are going through the test harness, all this is done
for us.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Since we just go through the normal test harness that sets up a request
for us, we don't need to do this anymore.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
rather than calling methods on the controller. We should test the
values returned by the controller rather than assuming that the
internals are implemented in a certain way.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I'm making this change so that I can construct response objects that
*don't* have the default headers applied. For example, I would like to
construct a response object from the return value of a controller.
If you need to construct a response object with the default headers,
then please use the alternate constructor:
`ActionDispatch::Response.create`
|
|\ \ \ \
| | | | |
| | | | | |
Change the paths for both Gemfile lines to be 'engines/blorgh'
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
They're now consistent.
Also changes the quotes to be single, so we only have one type of quote per line
[skip ci]
|
|\ \ \ \
| | | | |
| | | | | |
Fix ActiveRecord::Locking doc [ci skip]
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
WIP: Fix the AS::Callbacks terminator regression from 4.2.3
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Rails 4.2.3 AS::Callbacks will not halt chain if `false` is returned.
That is the behavior of specific callbacks like AR::Callbacks and
AM::Callbacks.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Document Bearer prefix for Authorization header [ci skip]
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Removed Mocha from app generators tests
|
| |/ / / / / |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
skipped assertion on datetime seconds precision as it is only valid for newer mysql verions
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | | |
newer mysql versions
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
It doesn't make sense to access the response object before a request is
made (how was a response object created without making a request?) This
commit splits testing default headers and default header mutation tests
and removes access to the pre-request response object.
|
| |_|/ / /
|/| | | |
| | | | |
| | | | | |
these should really be multiple tests.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
When the response object is `to_a`'d, that means it's been written to
the socket. It doesn't make sense to mutate the response object after
it's been written (and this may raise an exception in the future).
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When I originally reviewed the #20317, I believe these changes were
present, but it appears that it was later updated so that they were
removed. Since Travis hadn't re-run the build, this slipped through.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
And we are passing them as separate types in the query, which means 0
precision is still not supported by older versions of MySQL. I also
missed a handful of other cases where they need to be conditionally
applied.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Specifically, versions of MySQL prior to 5.6 do not support this, which
is what's used on Travis by default. The method `mysql_56?` appeared to
only ever be used to conditionally apply subsecond precision, so I've
generalized it and used it more liberally.
This should fix the test failures caused by #20317
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
AR: take precision into count when assigning a value to timestamp
attribute
|