- 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 提交于
-
- 18 8月, 2017 6 次提交
-
-
由 Ryuta Kamizono 提交于
* 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 28bb02a7
-
由 Ryuta Kamizono 提交于
Otherwise random CI failure will be caused. https://travis-ci.org/rails/rails/jobs/265848046#L777
-
由 Ryuta Kamizono 提交于
Since 213796fb, 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.
-
由 Ryuta Kamizono 提交于
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.
-
由 Ryuta Kamizono 提交于
Because `to_sql` is public API. I introduced `to_sql_and_binds` internal API to return SQL and binds.
-
由 Ryuta Kamizono 提交于
`where.not` with multiple conditions is still unexpected behavior. But `where.not` with only polymorphic association has already been fixed in 213796fb. Closes #14161. Closes #16983. Closes #17010. Closes #26207.
-
- 17 8月, 2017 2 次提交
-
-
由 Yasuo Honda 提交于
This commit addresses these failures when the backend RDBMS executes implicit commit for DDL like MySQL and Oracle. ```ruby $ ARCONN=mysql2 bin/test test/cases/integration_test.rb test/cases/timestamp_test.rb --seed 58225 -n '/^(?:TimestampTest#(?:test_index_is_created_for_both_timestamps)|IntegrationTest#(?:test_cache_key_for_newer_updated_at|test_cache_key_format_for_existing_record_with_updated_at|test_cache_key_format_for_existing_record_with_updated_at_and_custom_cache_timestamp_format))$/' -v Using mysql2 Run options: --seed 58225 -n "/^(?:TimestampTest#(?:test_index_is_created_for_both_timestamps)|IntegrationTest#(?:test_cache_key_for_newer_updated_at|test_cache_key_format_for_existing_record_with_updated_at|test_cache_key_format_for_existing_record_with_updated_at_and_custom_cache_timestamp_format))$/" -v TimestampTest#test_index_is_created_for_both_timestamps = 0.19 s = . IntegrationTest#test_cache_key_format_for_existing_record_with_updated_at = 0.05 s = F IntegrationTest#test_cache_key_format_for_existing_record_with_updated_at_and_custom_cache_timestamp_format = 0.02 s = F IntegrationTest#test_cache_key_for_newer_updated_at = 0.01 s = F Finished in 0.272880s, 14.6585 runs/s, 14.6585 assertions/s. 1) Failure: IntegrationTest#test_cache_key_format_for_existing_record_with_updated_at [/home/yahonda/git/rails/activerecord/test/cases/integration_test.rb:111]: --- expected +++ actual @@ -1 +1 @@ -"developers/1-20170717135609430848" +"developers/1-20170817135609283207" 2) Failure: IntegrationTest#test_cache_key_format_for_existing_record_with_updated_at_and_custom_cache_timestamp_format [/home/yahonda/git/rails/activerecord/test/cases/integration_test.rb:116]: --- expected +++ actual @@ -1 +1 @@ -"cached_developers/1-20170717135609" +"cached_developers/1-20170817135609" 3) Failure: IntegrationTest#test_cache_key_for_newer_updated_at [/home/yahonda/git/rails/activerecord/test/cases/integration_test.rb:147]: --- expected +++ actual @@ -1 +1 @@ -"developers/1-20170717145609430848" +"developers/1-20170817135609283207" 4 runs, 4 assertions, 3 failures, 0 errors, 0 skips $ ``` `ActiveRecord::TestCase::TimestampTest#test_index_is_created_for_both_timestamps` calls`ActiveRecord::TestCase::TimestampTest#setup` which updates `updated_at` column value. ```ruby @developer = Developer.first ... snip ... @developer.update_columns(updated_at: Time.now.prev_month) ``` This transaction expected to be rolled back, but if the backend RDBMS like MySQL perfomes implicit commit when DDL executed, this transacion is committed by `create table` statement inside `ActiveRecord::TestCase::TimestampTest#test_index_is_created_for_both_timestamps`. It causes these failures above which expect `update_at` column value are not changed(rollbacked).
-
由 Jon Moss 提交于
[ci skip]
-
- 16 8月, 2017 2 次提交
-
-
由 Koichi ITO 提交于
And enable `context_dependent` of Style/BracesAroundHashParameters cop.
-
由 Ryuta Kamizono 提交于
Since c51f9b61 changed the "_before_type_cast" expectation for enum.
-
- 15 8月, 2017 4 次提交
-
-
由 Ryuta Kamizono 提交于
`write_attribute_without_type_cast` is defined as a private method in `AttributeMethods::Write`, but `AttributeMethods::Dirty` overrode it as a public method. It should be kept the original visibility.
-
由 Ryuta Kamizono 提交于
Follow up of #29834. Fixes #30266.
-
由 Ryuta Kamizono 提交于
Add missing backticks Add missing * Add missing .
-
由 Aaron Wortham 提交于
When using a has_many through relation and then summing an attribute the distinct was not being used. This will ensure that when summing an attribute, the number is only used once when distinct has been used.
-
- 14 8月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
`Firm.id` is a bigint if mysql2 adapter is used, but `firm_id` is an integer. It will cause an out of range error. https://travis-ci.org/rails/rails/jobs/264112814#L776 https://travis-ci.org/rails/rails/jobs/264112835#L919
-
由 Kir Shatrov 提交于
-
- 13 8月, 2017 8 次提交
-
-
由 Ryuta Kamizono 提交于
The primary key on the owner record is abstracted as `join_foreign_key`.
-
由 Ryuta Kamizono 提交于
`source_type_info` is only used for `constraints` in `PolymorphicReflection`.
-
由 Ryuta Kamizono 提交于
We already have a test case for `serialize` with a custom coder in `PostgresqlHstoreTest`. https://github.com/rails/rails/blob/v5.1.3/activerecord/test/cases/adapters/postgresql/hstore_test.rb#L316-L335
-
由 Ryuta Kamizono 提交于
Since `Relation` includes `Enumerable`, it is enough to use `super` simply.
-
由 Ryuta Kamizono 提交于
It is incorrect to treat `options[:primary_key]` as `association_primary_key` if `has_many` associations because the `:primary_key` means the column on the owner record, not on the association record. It will break `ids_reader` and `ids_writer`. ```ruby people(:david).essay_ids # => ActiveRecord::StatementInvalid: Mysql2::Error: Unknown column 'essays.first_name' in 'field list': SELECT `essays`.first_name FROM `essays` WHERE `essays`.`writer_id` = 'David' ``` Fixes #14439.
-
由 Marc Rendl Ignacio 提交于
The previous paragraph mentions that you can hand off the same processing queue to multiple workers. This completes the following example below it.
-
由 Yukio Mizuta 提交于
-
- 12 8月, 2017 6 次提交
-
-
由 Ryuta Kamizono 提交于
It can use `AbstractReflection#table_name` simply.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
This comment was added at 97849deb, but `AssociationProxy` and `test_triple_equality` was removed at 1644663b. Currently the `===` is used for `test_decorated_polymorphic_where` that added at #11945. So I updated "association proxies" to "decorated models". And also, currently `Core::ClassMethods` appears in the doc. http://api.rubyonrails.org/classes/ActiveRecord/Core/ClassMethods.html But it looks like that the methods in the module is not public API. So I also added `# :nodoc:` to the module.
-
由 yalab 提交于
-
由 yukihirop 提交于
-
由 Ryuta Kamizono 提交于
Fixes #29045.
-
- 11 8月, 2017 3 次提交
-
-
由 ohbarye 提交于
refs: https://github.com/rails/rails/pull/30161 ``` $ echo "+@size+" | rdoc --pipe <p>+@size+</p> $ echo "<tt>@size</tt>" | rdoc --pipe <p><code>@size</code></p> ``` [ci skip]
-
由 zverok 提交于
-
由 Ryuta Kamizono 提交于
Because `JSONSharedTestCases` is also used for `Mysql2JSONTest`.
-