- 01 9月, 2017 5 次提交
-
-
由 Yasuo Honda 提交于
`to_i` was added for SQLite3 adapter which did not handle number but sqlite3 gem already supports it then `to_i` is unnecessary. else condition is kept for adapters which return string, i.e. mysql(not mysql2) and sqlserver. Renamed `test_cache_does_not_wrap_string_results_in_arrays` to `test_cache_does_not_wrap_results_in_arrays` to explain the current behavior. most of adapters return integer, not only string. * Refer these commits: "future proofing the sqlite3 adapter code" https://github.com/rails/rails/commit/beda2d43d6ac5c3435fc2fba0cbd108c20fe1c67 "Refactor calculation test to remove unneeded SQLite special case." https://github.com/rails/rails/commit/47d568ed3fc701934ebe80b276f3d8bf6951c93f "no need to to_i, sqlite does that for us" https://github.com/rails/rails/commit/6cf44a1bd64ba10497742d70ad78fe68faa16e99
-
由 Ryuta Kamizono 提交于
Fixes #30496.
-
由 Yasuo Honda 提交于
when tested with MariaDB 10.2.8 or higher Refer #30485 https://mariadb.com/kb/en/the-mariadb-library/alter-table/#drop-column-if-exists-col_name-cascaderestrict > MariaDB starting with 10.2.8 > Dropping a column that is part of a multi-column UNIQUE constraint is not permitted.
-
由 Akira Matsuda 提交于
-
由 Matthew Draper 提交于
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.
-
- 30 8月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
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>' ```
-
- 29 8月, 2017 1 次提交
-
-
由 Prathamesh Sonpatki 提交于
- Closes #30441
-
- 28 8月, 2017 4 次提交
-
-
由 Prathamesh Sonpatki 提交于
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
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
-
由 Ryuta Kamizono 提交于
Because `add_as_polymorphic_through` is only called when `options[:source_type]` is true.
-
- 27 8月, 2017 5 次提交
-
-
由 Ryuta Kamizono 提交于
`RuntimeReflection#alias_candidate` is no longer used since 0408e212.
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
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`.
-
由 Yoshiyuki Hirano 提交于
-
- 26 8月, 2017 2 次提交
-
-
由 Yoshiyuki Hirano 提交于
- 25 8月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
This regression was caused by caa178c1. The block for `set_inverse_instance` should also be passed to join dependency. Fixes #30402.
-
由 Yoshiyuki Hirano 提交于
-
- 24 8月, 2017 5 次提交
-
-
由 Yasuo Honda 提交于
when other `AutomaticInverseFindingTests` load `:comments` fixture but does not load `:posts`. Refer #30385 for similar issue
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
由 Koichi ITO 提交于
-
由 keepcosmos 提交于
-
- 23 8月, 2017 3 次提交
-
-
由 Yasuo Honda 提交于
There were similar pull requests #26370 #27575 fixed by different way by moving `require "models/post"` before `require "models/comment"`
-
由 Yasuo Honda 提交于
`: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.
-
由 Gabriel Courtemanche 提交于
-
- 22 8月, 2017 5 次提交
-
-
由 Ryuta Kamizono 提交于
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.
-
由 Ryuta Kamizono 提交于
-
由 yui-knk 提交于
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.
-
由 Yoshiyuki Hirano 提交于
-
由 Yoshiyuki Hirano 提交于
-
- 21 8月, 2017 3 次提交
-
-
由 Ryuta Kamizono 提交于
`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.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
- 20 8月, 2017 3 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
This is only used for the internal `column_spec` and `column_spec_for_primary_key`.
-
由 Ryuta Kamizono 提交于
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]] ```
-
- 19 8月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
-