| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Move serialization dirty into serialization.rb
|
| |
|
|\
| |
| | |
Add missing information for `id` field when used with `select` [ci skip]
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
Since Rails 4.0, we add an ORDER BY in the `first` method to ensure consistent
results among different database engines. But for singular associations this
behavior is not needed since we will have one record to return. As this
ORDER BY option can lead some performance issues we are removing it for singular
associations accessors.
Fixes #12623.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a bug where `select(:id)` combined with `joins()` raised:
```
ActiveRecord::StatementInvalid: SQLite3::SQLException: ambiguous column name: id:
SELECT id, authors.author_address_id
FROM "posts"
INNER JOIN "authors"
ON "authors"."id" = "posts"."author_id"
ORDER BY posts.id LIMIT 3
```
The `select_values` are still String and Symbols because other parts (mainly calculations.rb)
rely on that fact.
/cc @tenderlove
|
|\
| |
| | |
setup Bundler in engines `bin/rails` stub.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is necessary when bundling gems locally using `BUNDLE_PATH`.
Without this patch `bin/rails` fails with:
```
/Users/senny/.rbenv/versions/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rails/all (LoadError)
from /Users/senny/.rbenv/versions/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from bin/rails:7:in `<main>'
```
|
| | |
|
|\ \
| | |
| | | |
Fail early with "Primary key not included in the custom select clause" i...
|
| | |
| | |
| | |
| | |
| | | |
find_in_batches
Before this patch find_in_batches raises this error only on second iteration. So you will know about the problem only when you get the batch size threshold.
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
With the introduction of `#second` method and friends, we added an
offsets hash which replaced the @first variable, so removing it from the
reset method to avoid creating an unused variable now.
Introduced in bc625080308e4853ae3036f2ad74fe3826e463ef.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Before this patch after the changes are applied the changes can be only
accessed using string keys, but before symbols are also accepted.
After this change every state of the model will be consistent.
|
| |
| |
| |
| | |
This variable is internal and should not be exposed to end users
|
|\ \
| | |
| | |
| | | |
Ensure #second (and others) acts like #first AR finder
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit bring the famous ordinal Array instance methods defined
in ActiveSupport into ActiveRecord as fully-fledged finders.
These finders ensure a default ascending order of the table's primary
key, and utilize the OFFSET SQL verb to locate the user's desired
record. If an offset is defined in the query, calling #second adds
to the offset to get the actual desired record.
Fixes #13743.
|
|\ \ |
|
|/ / |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The PR #13767 added link to the upgrading guide to explain
details about activerecord_deprecated-finders. However the link target
features a stack of changes not releated at all. Also the relevant details
are not very informative.
I think we better link to the README so people can see what the gem is about
and how to use it.
/cc @chancancode @zzak
|
| |
| |
| |
| | |
The file is config/secrets.yml, not config/initializers/secrets.yml.
|
|\ \
| | |
| | | |
Add link to upgrade guide for full list of deprecated finders [ci skip]
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix a typo that says you application [ci skip]
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Fix for incorrect link that is pointing to Rails blog [ci skip]
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Update Error Message when secrets.secret_key_base isn't given
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
set encoding for pipe to binary mode
|
| | | | | |
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Update Changelog, Spring is under rails/spring [ci skip]
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Spring in now under rails/spring [ci skip]
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
spring gem moved to rails/spring
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Restore ActiveRecord states after a rollback for models w/o callbacks
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This fixes a regression (#13744) that was caused by 67d8bb9.
In 67d8bb9, we introduced lazy rollback for records, such that the
record's internal states and attributes are not restored immediately
after a transaction rollback, but deferred until they are first
accessed.
This optimization is only performed when the model does not have any
transactional callbacks (e.g. `after_commit` and `after_create`).
Unfortunately, the models used to test the affected codepaths all
comes with some sort of transactional callbacks. Therefore this
codepath remains largely untested until now and as a result there are
a few issues in the implementation that remains hidden until now.
First, the `sync_with_transaction_state` (or more accurately,
`update_attributes_from_transaction_state`) would perform the
synchronization prematurely before a transaction is finalized (i.e.
comitted or rolled back). As a result, when the actuall rollback
happens, the record will incorrectly assumes that its internal states
match the transaction state, and neglect to perform the restore.
Second, `update_attributes_from_transaction_state` calls `committed!`
in some cases. This in turns checks for the `destroyed?` state which
also requires synchronization with the transaction stae, which causes
an infnite recurrsion.
This fix works by deferring the synchronization until the transaction
has been finalized (addressing the first point), and also unrolled
the `committed!` and `rolledback!` logic in-place (addressing the
second point).
It should be noted that the primary purpose of the `committed!` and
`rolledback!` methods are to trigger the relevant transactional
callbacks. Since this code path is only entered when there are no
transactional callbacks on the model, this shouldn't be necessary. By
unrolling the method calls, the intention here (to restore the states
when necessary) becomes more clear.
|
|\ \ \ \
| | | | |
| | | | | |
Correct the version number to 4 in guides[ci skip]
|
|/ / / / |
|
| | | | |
|
| | | | |
|
|/ / / |
|
| | | |
|