| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| | |
Treat invalid uuid as nil
Conflicts:
activerecord/CHANGELOG.md
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
activerecord/CHANGELOG.md
|
| |\ \
| | | |
| | | |
| | | | |
Closes #15936
|
| | |/ |
|
|/ /
| |
| |
| |
| |
| |
| | |
This reverts commit 6f3c64eeb1dc8288dae49f114aaf619adc7dcb7f.
Conflicts:
activerecord/CHANGELOG.md
|
|/ |
|
|\
| |
| | |
Dump PostgreSQL primary key with custom function as a default.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For example, if use pgcrypto extension in PostgreSQL 9.4 beta 1, where
uuid-ossp extension isn't available for moment of writing, and thus to
use a gen_random_uuid() method as a primary key default.
In this case schema dumper wasn't able to correctly reconstruct
create_table statement and lost primary key constraint on schema load.
Fixes #16111.
|
|/
|
|
|
| |
Also reordered some of the items to put newer ones on top (same order as
CHANGELOGs), which makes it easier to diff while we are still working on it.
|
|
|
|
| |
The changelog entry for #14899 was missing.
|
| |
|
|
|
|
|
|
| |
This reverts commit a03097759bd7103bb9db253e7ba095f011453f75.
This needs more work before it would work correctly on master.
|
|
|
|
|
|
|
|
| |
Fixed issue with ActiveRecord serialize object as JSON
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/attribute_methods/serialization.rb
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
cade/fix_counter_cache_count_with_association_selects
Add `:all` argument to `count` in `reset_counters`
Conflicts:
activerecord/CHANGELOG.md
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Prior to this fix, if an association had a scope with a `select`,
calls to `reset_counters` would generate invalid SQL and throw:
ActiveRecord::StatementInvalid: [$DB_ADAPTER]: wrong number of
arguments to function COUNT()
References #10710, #13648
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
morgoth/fix-automatic-maintaining-test-schema-for-sql-format"
This reverts commit 46139d33c06715e74ad450428ece3ee84da98579, reversing
changes made to 8f247871bb18b2e3036a05df5f62cbfe3b402586.
Conflicts:
activerecord/CHANGELOG.md
|
|\
| |
| |
| | |
rename primary key sequence only if it exists
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Fix bug, when ':dependent => :destroy' violates foreign key constraints
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/associations/builder/association.rb
activerecord/lib/active_record/associations/builder/has_one.rb
|
| |
| |
| |
| | |
constraints, issue #12380
|
|\ \
| | |
| | |
| | | |
Detect in-place modifications on Strings
|
|\ \ \
| | | |
| | | |
| | | | |
Add AR::Base#valid! method
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Making this change revealed several subtle bugs related to models with
no primary key, and anonymous classes. These have been fixed as well,
with regression tests added.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Reliant on https://github.com/rails/rails/pull/15747 but pulled to a
separate PR to reduce noise. `has_many :through` associations have the
undocumented behavior of automatically detecting counter caches.
However, the way in which it does so is inconsistent with counter caches
everywhere else, and doesn't actually work consistently.
As with normal `has_many` associations, the user should specify the
counter cache on the `belongs_to`, if they'd like it updated.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
[ci skip]
/cc @chancancode @zzak
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is a partial fix for #15853. It only works when a `preload`
is issued and not an `eager_load`. I've added a skipped failing
test-case to keep in mind that we need to deal with `eager_load`.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We previously only did this if the old value was zero, to make sure
numericality validations run and failed if the user gave 'wibble' as the
value, which would be type cast to 0. However, numericality validations
will fail if there are any non-numeric characters in the string, so 5 ->
'5wibble' should also be marked as changed.
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
This is public API, and `simple_form` depends on the `nil` return value.
We need to go through a deprecation cycle to return a null object. If
people want hash access, they can access the hash.
|
| | |
| | |
| | |
| | | |
/cc @sgrif
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | | |
Don't save through records twice
Conflicts:
activerecord/CHANGELOG.md
activerecord/test/cases/associations/has_many_through_associations_test.rb
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If the through record gets created in an `after_create` hook that is
defined before the association is defined (therefore after its
`after_create` hook) get saved twice. This ensures that the through
records are created only once, regardless of the order of the hooks.
|
|/ / |
|
| | |
|
|\ \
| | |
| | | |
[ci skip] Use `an` for SQL
|
| | | |
|
|/ /
| |
| |
| |
| | |
We've stopped using it internally, in favor of polymorphism. So should
you!
|
| |
| |
| |
| | |
Fixes #15705.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
member = Member.new(club: Club.new)
member.save!
Before:
member.current_membership.club_id # => nil
After:
member.current_membership.club_id # => club's id
|
| |
| |
| |
| |
| |
| | |
We have several mutable types on Active Record now. (Serialized, JSON,
HStore). We need to be able to detect if these have been modified in
place.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
morgoth/fix-automatic-maintaining-test-schema-for-sql-format
ActiveRecord::Migration.maintain_test_schema! doesn't work with structure.sql
Conflicts:
activerecord/CHANGELOG.md
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
schema format.
Additionally:
* It changes `purge` task on `sqlite3` adapter to recreate database file, to
be consistent with other adapters.
* Adds `purge` step when loading from `schema.rb`
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The column name given by the adapter doesn't include the table
namespace, so going through the hashed version of the result set causes
overridden keys.
Fixes #15649
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The original patch that added this concept can be found
[here](https://web.archive.org/web/20090601022739/http://dev.rubyonrails.org/ticket/9767).
The current default behavior is to cache everything except serialized
columns, unless the user specified otherwise. If anyone were to specify
otherwise, many types would actually be completely broken. Still, the
method is left in place with a deprecation warning in case anyone is
actually still calling this method.
|
| | | |
|
| | | |
|