| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| |
| |
| | |
greyblake/dont_write_timestamps_if_they_are_not_attributes
Write timestamps only if there are timestamps columns
Conflicts:
activerecord/CHANGELOG.md
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[Yves Senn & Matthew Draper]
The column check was embodied in the defaul index name.
If the :name option was used, the specified columns were not verified at all.
Given:
```
assert connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_yo_momma)
```
That index could have been defined on any field, not necessarily on `:foo_id`.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently when we call id_was and we have a custom primary key name
Active Record will return the current value of the primary key. This
make impossible to correctly do an update operation if you change the
id.
Fixes #16413
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The rake tasks and the `DatabaseTakss` adapter classes used to
assume a configuration at some places. This forced the rake
tasks to establish a specific connection before calling into
`load_schema`.
After #15394 this started to cause issues because it could
`purge` the wrong database before loading the schema.
|
| |
| |
| |
| |
| |
| | |
morgoth/fix-automatic-maintaining-test-schema-for-sql-format""
This reverts commit 5c87b5c5248154cf8aa76cce9a24a88769de022d.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
joker1007/fix_decimal_cast_from_float_with_large_precision
Fix type casting to Decimal from Float with large precision
Conflicts:
activerecord/CHANGELOG.md
|
| | |
| | |
| | |
| | |
| | | |
When I defines large precision column at RDBMS,
I assigns float value, raise ArgumentError (precision too large).
|
|/ /
| |
| |
| |
| |
| | |
`source_macro` is no longer used in any ActiveRecord code. I've
chosen to deprecate it because it was not marked as nodoc and may
be in use outside of rails source.
|
| | |
|
|\ \
| | |
| | |
| | | |
Add support for Postgresql JSONB
|
|/ /
| |
| |
| | |
[Philippe Creux, Chris Teague]
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously this method always established a connection to the test database.
This resulted in buggy behavior when combined with other tasks like
`bin/rake db:schema:load`.
This was one of the reasons why #15394 (22e9a91189af2c4e6217a888e77f22a23d3247d1)
was reverted:
> I’ve replicated it on a new app by the following commands: 1) rails
generate model post:title, 2) rake db:migrate, 3) rake
db:schema:load, 4) rails runner ‘puts Post.first’. The last command
goes boom. Problem is that rake db:schema:load wipes the database,
and then doesn’t actually restore it. This is all on MySQL. There’s
no problem with SQLite.
-- DHH
https://github.com/rails/rails/commit/22e9a91189af2c4e6217a888e77f22a23d3247d1#commitcomment-6834245
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Closes #16261.
[Matthew Draper, Yves Senn]
Using `DEFAULT NULL` results in the same behavior as `DROP DEFAULT`.
However, PostgreSQL will cast the default to the columns type,
which leaves us with a default like "default NULL::character varying".
/cc @matthewd
|
|\ \
| | |
| | |
| | |
| | |
| | | |
* Allow to specify a type for foreign key column in migrations
* unified the docs
* some cleanup in CHANGELOG
|
|/ /
| |
| |
| | |
[Andrey Novikov & Łukasz Sarnacki]
|
| |
| |
| |
| |
| |
| |
| |
| | |
Before this change, create_join_table would not remove the common prefix
in the join table name, unlike ActiveRecord::Reflections. A HABTM
between Music::Artist and Music::Record would use a table
music_artists_records, while create_join table would create
music_artists_music_records.
|
|\ \
| | |
| | |
| | | |
Dont swallow errors when bad alias_method
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|