| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
This reverts commit dd3ea17191e316aeebddaa7b176f6cfeee7a6365 and add a
regression test.
Fixes #15418
|
| |
| |
| |
| |
| |
| | |
This is a follow up to #15556
@kuldeepaggarwal did submit this patch way back (#13624).
|
| |
| |
| |
| | |
[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.
|
| |
| |
| |
| |
| |
| |
| | |
The migration numbers were normalized different ways. This left
the task output in an inconsistent state.
Closes #15538.
|
|\ \
| | |
| | |
| | | |
Baseclass becomes! subclass
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | | |
Remove deprecated method ActiveRecord::Migrator.proper_table_name
|
|/ / / |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fix regression on eager loading association based on SQL query rather than existing column.
Conflicts:
activerecord/CHANGELOG.md
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
than existing column.
Fixes #15480.
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Return a null column when no column exists for an attribute
Conflicts:
activerecord/CHANGELOG.md
|
| | | | | |
|
|\ \ \ \ \
| |_|/ / /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
implement ActiveRecord::Base#pretty_print
Conflicts:
activerecord/CHANGELOG.md
|
| | | | | |
|
| |/ / /
|/| | | |
|
| | | | |
|
| | | | |
|
| |_|/
|/| | |
|
| | |
| | |
| | |
| | |
| | | |
This is an intermediate solution. It is related to the refactoring @sgrif
is making and will change in the future.
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fixed #columns_for_distinct of postgresql adapter
Conflicts:
activerecord/CHANGELOG.md
|
| | | | |
|
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The solution presented in this patch is not efficient. We should replace it
in the near future. The following needs to be worked out:
* Is `@attributes` storing the Ruby or SQL representation?
* `cacheable_column?` is broken but `hstore` and `json` rely on that behavior
Refs #15369.
/cc @sgrif @rafaelfranca
|
|\ \ \
| | | |
| | | | |
Remove AR Properties from the public API
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Making this part of the public API was premature, let's make it private
again while I continue to work on the surrounding code.
|
|/ / / |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
After ad7b5efb55bcc2e0ccd3e7f22a81e984df8676d1, which changed how
has_an_belongs_to_many used to work, we start raising an error when
redefining the same has_an_belongs_to_many association. This commits fix
that regression.
[Fixes #14983]
|