| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Don't use remove_method or remove_possible_method just before a new
definition: at best the purpose is unclear, and at worst it creates a
race condition.
Instead, prefer redefine_method when practical, and
silence_redefinition_of_method otherwise.
|
|\ \ \
| | | |
| | | | |
Delegate :rindex, :slice, :rotate(missing) to 'records'
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Unify the internal source control .keep file name
|
| |/ / / |
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Without this, `db:structure:dump` task raises an error as follwing:
```
can't modify frozen String
activerecord/lib/active_record/tasks/sqlite_database_tasks.rb:77:in `run_cmd_error'
activerecord/lib/active_record/tasks/sqlite_database_tasks.rb:72:in `run_cmd'
activerecord/lib/active_record/tasks/sqlite_database_tasks.rb:52:in `structure_dump'
activerecord/lib/active_record/tasks/database_tasks.rb:219:in `structure_dump'
activerecord/lib/active_record/railties/databases.rake:279:in `block (3 levels) in <main>'
railties/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
railties/lib/rails/commands/rake/rake_command.rb:20:in `perform'
railties/lib/rails/command.rb:48:in `invoke'
railties/lib/rails/commands.rb:18:in `<main>'
```
|
|\ \ \
| | | |
| | | | |
Added CHANGELOG for #30360 [ci skip]
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Clarify that bulk option is supported only by MySQL
|
| |/ / /
| | | |
| | | |
| | | | |
- Closes #30441
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If `:readers` fixture is loaded before the test, it will be failed.
Use `firm.developer_ids` instead because we don't have `:contracts`
fixture for now.
https://travis-ci.org/rails/rails/jobs/268976230#L729
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
always true
Because `add_as_polymorphic_through` is only called when
`options[:source_type]` is true.
|
| | | |
| | | |
| | | |
| | | | |
`RuntimeReflection#alias_candidate` is no longer used since 0408e212.
|
| | | |
| | | |
| | | | |
Context: https://github.com/rails/rails/pull/29619#discussion_r125158589
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
I was added a table options after `force: :cascade` in #17569 for not
touching existing tests (reducing diff). But `force: :cascade` is not an
important information. So I prefer to place a table options before
`force: :cascade`.
|
| | | |
|
| | |
| | |
| | |
| | | |
https://travis-ci.org/rails/rails/jobs/268599781#L784
|
|\ \ \
| | | |
| | | | |
Fix broken doc for Active Record [ci skip]
|
| | | | |
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
This regression was caused by caa178c1. The block for
`set_inverse_instance` should also be passed to join dependency.
Fixes #30402.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
when other `AutomaticInverseFindingTests` load `:comments` fixture
but does not load `:posts`.
Refer #30385 for similar issue
|
| | | |
|
|\ \ \
| | | |
| | | | |
Refactor `SchemaDumper` to make it possible to adapter specific customization
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Currently `SchemaDumper` is only customizable for column options. But
3rd party connection adapters (oracle-enhanced etc) need to customizable
for table or index dumping also. To make it possible, I introduced
adapter specific `SchemaDumper` classes for that.
|
| | | | |
|
| |/ /
|/| | |
|
|\ \ \
| | | |
| | | | |
`counter_cache` requires association class before `attr_readonly`
|
| |/ /
| | |
| | |
| | |
| | | |
There were similar pull requests #26370 #27575 fixed by different way
by moving `require "models/post"` before `require "models/comment"`
|
|\ \ \
| | | |
| | | | |
Load :author_addresses fixture to keep data integrity with :authors
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`:authors` has a foreign key to `:author_addresses`.
If only `:authors` fixture loaded into the database which supports
foreign key and checks the existing data when enabling foreien keys
like Oracle, it raises the following error
`ORA-02298: cannot validate (ARUNIT.FK_RAILS_94423A17A3) - parent keys not found`
It is because there is no parent data exists in `author_addresses` table.
Here are how other database with foreign key support works:
- MySQL does not check the existing data when enabling foreign key by `foreign_key_checks=1`
https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_foreign_key_checks
> Setting foreign_key_checks to 1 does not trigger a scan of the existing table data. Therefore, rows added to the table while foreign_key_checks=0 will not be verified for consistency.
- PostgreSQL database itself has a feature to check existing data when
enabling foreign key and discussed at #27636, which is reverted.
|
|\ \ \
| |/ /
|/| | |
Add TransactionTimeout for MySQL error code 1205
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
ActiveRecord associations automatically guess the inverse associations.
But this feature does not work correctly on assoctions for STI.
For example, before this commit
```
class Post < ActiveRecord::Base
belongs_to :author
end
class SpecialPost < Post; end
class Author < ActiveRecord::Base
has_many :posts
has_many :special_posts
end
```
`author.posts.first.author` works correctly, but
`author.special_posts.first.author` does not work correctly.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
yhirano55/use_https_instead_of_http_in_activerecord
[activerecord] Update links to use https instead of http [ci skip]
|
| |/ / |
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| | |
`SET time zone 'value'` is an alias for `SET timezone TO 'value'`.
https://www.postgresql.org/docs/current/static/sql-set.html
So if `variables["timezone"]` is specified, it is enough to
`SET timezone` once.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
This is only used for the internal `column_spec` and
`column_spec_for_primary_key`.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
currently integer types extracts the `limit` from `sql_type`. But the
lookup key of type map is the `oid` in postgresql adapter. So in most
case `sql_type` is passed to `extract_limit` as `""` and `limit` is
extracted as `nil`.
https://github.com/rails/rails/blob/v5.1.0.beta1/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L445
In mysql2 adapter, `limit` is registered correctly without extracting
from `sql_type`.
https://github.com/rails/rails/blob/v5.1.0.beta1/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb#L678-L682
Postgresql adapter should also be registered correctly.
``` ruby
conn = ActiveRecord::Base.connection
conn.select_all("SELECT 1::smallint, 2::integer, 3::bigint").column_types.map do |name, type|
[name, type.limit]
end
```
Before:
``` ruby
# => [["int2", nil], ["int4", nil], ["int8", nil]]
```
After:
``` ruby
# => [["int2", 2], ["int4", 4], ["int8", 8]]
```
|
| | |
|
| |
| |
| |
| |
| | |
* Test `test_unabstracted_database_dependent_types` for `PostgreSQLAdapter`
* Add `test_change_column_with_new_precision_and_scale` for `SQLite3Adapter`
* This test case and comment was lost at 28bb02a78fd47527bb7a208d01a4594bb212812c
|
| |
| |
| |
| |
| |
| | |
Otherwise random CI failure will be caused.
https://travis-ci.org/rails/rails/jobs/265848046#L777
|
| |
| |
| |
| |
| |
| |
| |
| | |
(#29944)
Since 213796f, it was lost the ability that SQL with binds for `insert`,
`update`, and `delete` (like `select_all`). This restores the ability
because `insert`, `update`, and `delete` are public API, so it should
not be removed without deprecation.
|
| |
| |
| |
| |
| |
| |
| | |
affected by scoping (#29997)
I tried to change the expectation in #29976, but it is expected behavior
at least for now. So I added the test cases to prevent anyone change the
expectation.
|