- 22 8月, 2017 4 次提交
-
-
由 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 提交于
-
- 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]] ```
-
- 18 8月, 2017 2 次提交
-
-
由 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 提交于
Because `to_sql` is public API. I introduced `to_sql_and_binds` internal API to return SQL and binds.
-
- 17 8月, 2017 1 次提交
-
-
由 Jon Moss 提交于
[ci skip]
-
- 15 8月, 2017 3 次提交
-
-
由 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.
-
由 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 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 13 8月, 2017 6 次提交
-
-
由 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.
-
- 12 8月, 2017 5 次提交
-
-
由 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 提交于
-
由 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 提交于
Otherwise `ConnectionPool#reap` may run before `@connections` has initialized. https://travis-ci.org/rails/rails/jobs/263037427#L888-L890
-
- 09 8月, 2017 4 次提交
-
-
由 Anthony Ross 提交于
-
由 chopraanmol1 提交于
-
由 Julia López 提交于
-
由 Sean Griffin 提交于
This module has behavior that is not present in `ActiveModel::Dirty`, which is intended to be public API.
-
- 08 8月, 2017 3 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 chopraanmol1 提交于
Currently if relation object are passed to where condition for has one or has many association wrong set of primary key and foreign key are selected. Changed code to use 'join' primary key and foreign key over 'association' primary key and foreign key.
-
由 Julia López 提交于
-
- 07 8月, 2017 1 次提交
-
-
由 yui-knk 提交于
`ActiveRecord::ConnectionAdapters::QueryCache::ConnectionPoolConfiguration` depends on `Concurrent::Map`.
-
- 05 8月, 2017 1 次提交
-
-
由 Yasuo Honda 提交于
MySQL 5.7 and PostgreSQL 9.6 allow table identifiers have the dollar sign. * MySQL 5.7 https://dev.mysql.com/doc/refman/5.7/en/identifiers.html > Permitted characters in unquoted identifiers: > ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore) * PostgreSQL 9.6 https://www.postgresql.org/docs/9.6/static/sql-syntax-lexical.html > SQL identifiers and key words must begin with a letter (a-z, but also letters with diacritical marks and non-Latin letters) or an underscore (_). Subsequent characters in an identifier or key word can be letters, underscores, digits (0-9), or dollar signs ($). Note that dollar signs are not allowed in identifiers according to the letter of the SQL standard, so their use might render applications less portable. The SQL standard will not define a key word that contains digits or starts or ends with an underscore, so identifiers of this form are safe against possible conflict with future extensions of the standard. Address #30044 [Yasuo Honda & Ryuta Kamizono]
-