- 05 8月, 2016 2 次提交
-
-
由 David Heinemeier Hansson 提交于
-
由 David Heinemeier Hansson 提交于
-
- 04 8月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
`insert`, `update`, `delete`, and `exec_query` have a default value against `name` and `binds`. But `exec_insert`, `exec_update`, and `exec_delete` not have. It is an inconvenience and inconsistent.
-
- 03 8月, 2016 1 次提交
-
-
由 Arthur Neves 提交于
-
- 28 7月, 2016 4 次提交
-
-
由 Ryuta Kamizono 提交于
`current_database` executes a query and `table_comment` is called to all tables even if a table does not have a comment. Using `current_database` increases extra queries.
-
由 Ryuta Kamizono 提交于
Caching a mutable string causes the following issue. ``` Loading development environment (Rails 5.1.0.alpha) irb(main):001:0> ActiveRecord::Base.connection.quote_table_name('foo') << '!!' => "`foo`!!" irb(main):002:0> ActiveRecord::Base.connection.quote_table_name('foo') << '!!' => "`foo`!!!!" irb(main):003:0> ActiveRecord::Base.connection.quote_table_name('foo') << '!!' => "`foo`!!!!!!" ```
-
由 Ryuta Kamizono 提交于
To avoid relying on the connection adapter for type casting binds.
-
由 Takeshi AKIMA 提交于
[Rafael Mendonça França + Takeshi AKIMA]
-
- 26 7月, 2016 2 次提交
-
-
由 Ryuta Kamizono 提交于
If reuse `QUOTED_TRUE` and `QUOTED_FALSE` without frozen, causing the following issue. ``` Loading development environment (Rails 5.1.0.alpha) irb(main):001:0> ActiveRecord::Base.connection.quote(true) << ' foo' => "1 foo" irb(main):002:0> ActiveRecord::Base.connection.quote(true) << ' foo' => "1 foo foo" irb(main):003:0> type = ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::MysqlString.new => #<ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::MysqlString:0x007fd40c15e018 @precision=nil, @scale=nil, @limit=nil> irb(main):004:0> type.serialize(true) << ' bar' => "1 foo foo bar" irb(main):005:0> type.cast(true) << ' bar' => "1 foo foo bar bar" ```
-
由 Ryuta Kamizono 提交于
Because `type_cast` against `binds` always requires `attr.value_for_database` and this pattern appears frequently.
-
- 25 7月, 2016 1 次提交
-
-
由 Xavier Noria 提交于
-
- 24 7月, 2016 2 次提交
-
-
由 Ryuta Kamizono 提交于
`StatementCache` is hard-coded in `cacheable_query` and be passed `visitor` and `collector` from connection adapter. Simply it is enough to pass a collected value.
-
由 Xavier Noria 提交于
Where appropriatei, prefer the more concise Regexp#match?, String#include?, String#start_with?, or String#end_with?
-
- 19 7月, 2016 2 次提交
-
-
由 Ryuta Kamizono 提交于
Because `connection#to_sql` does not mutate `binds`.
-
- 18 7月, 2016 2 次提交
-
-
由 bogdanvlviv 提交于
Refactored method `ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#default_sequence_name`
-
由 Ryuta Kamizono 提交于
-
- 17 7月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up to #20818. `retrieve_connection` is passed `spec_name` instead of `klass` since #24844.
-
- 16 7月, 2016 1 次提交
-
-
由 Prathamesh Sonpatki 提交于
- Followup of https://github.com/rails/rails/pull/23179.
-
- 14 7月, 2016 1 次提交
-
-
由 Grey Baker 提交于
Keeps schema migration inserts as a single commit, so we still get all of the benefits of https://github.com/rails/rails/commit/42dd2336b31a8d98776d039a2b9fd7f834156a78, but allows for easier git diff-ing. Fixes #25504.
-
- 13 7月, 2016 1 次提交
-
-
由 Jeremy Wadsack 提交于
loaded model classes have their connections wrapped in transactions. See #17776 In Rails 4 config.eager_load was changed to false in the test environment. This means that model classes that connect to alternate databases with establish_connection are not loaded at start up. If use_transactional_fixtures is enabled, transactions are wrapped around the connections that have been established only at the start of the test suite. So model classes loaded later don't have transactions causing data created in the alternate database not to be removed. This change resolves that by creating a new connection.active_record notification that gets fired whenever a connection is established. I then added a subscriber after we set up transactions in the test environment to listen for additional connections and wrap those in transactions as well.
-
- 12 7月, 2016 1 次提交
-
-
由 Santosh Wadghule 提交于
-
- 08 7月, 2016 1 次提交
-
-
由 Alex Kitchens 提交于
This includes minor grammar fixes throughout the file.
-
- 06 7月, 2016 5 次提交
-
-
由 Alex Kitchens 提交于
-
由 Matthew Draper 提交于
-
由 Matthew Draper 提交于
This way, we aren't racing other threads, so we don't need to re-check the conditional. And we no longer need to hold the lock while calling remove (which can choose to make a new connection while we wait).
-
由 Matthew Draper 提交于
A concurrent thread may have also detected it to be stale, and already released (or even reassigned) it by now. Fixes #25585
-
由 Matthew Draper 提交于
A thread can only release a connection if it owns it, or it's owned by a thread that has died.
-
- 02 7月, 2016 2 次提交
-
-
由 Ryuta Kamizono 提交于
Actually schema dumper/creation supports composite primary key (#21614). Therefore it should not show the warning about composite primary key in connection adapter. This change moves the warning to `AttributeMethods::PrimaryKey` and suppress the warning for habtm join table. Fixes #25388.
-
由 Ryuta Kamizono 提交于
`create_table_info_cache` is used for sharing `create_table_info` both `table_options` and `foreign_keys`. But `foreign_keys` no longer uses `create_table_info_cache` by #25307. No need caching anymore.
-
- 25 6月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
This was added at c7c3f73f but it never raised because MySQL cannot create text/blob columns with a default value.
-
- 24 6月, 2016 1 次提交
-
-
由 Benjamin Quorning 提交于
The implementation from abstract/database_statements.rb seems to work just fine. And with ActiveRecord::Result now implementing an optimized #first method, the performance concerns previously addressed in https://github.com/rails/rails/commit/bf79aa4fc14aeb2646331e767038acf0b77e9e7f should not be an issue.
-
- 14 6月, 2016 1 次提交
-
-
由 Rafael Mendonça França 提交于
Fixes #25391
-
- 10 6月, 2016 2 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 07 6月, 2016 2 次提交
-
-
由 Ryuta Kamizono 提交于
Fixes #25300.
-
由 Ryuta Kamizono 提交于
-
- 02 6月, 2016 1 次提交
-
-
由 Sean Griffin 提交于
Currently CI is broken due to 56a61e0c and c4cb6862. This occurred because the failures are not present on SQLite which is what I normally run locally before pushing. The optimizations to our YAML size were dropping mutations, as `with_type` didn't set the previous value if it'd already been read (that method was never really designed to be used with values on individual objects, it was previously only used for defaults). I'm questioning whether there's a better place to be handling the exclusion of the type, but this will fix the failing build. Additionally, there was a bug in `remove_foreign_key` if you passed it an options hash containing `to_table`. This now occurs whenever removing a reference, as we always normalize to a hash. [Sean Griffin & Ryuta Kamizono]
-
- 01 6月, 2016 1 次提交
-
-
由 Sean Griffin 提交于
The code incorrectly assumes that the option was written as `foreign_key: true`, but that is not always the case. This now mirrors the behavior of reverting `add_foreign_key`. The code was changed to use kwargs while I was touching it, as well. This could really use a refactoring to go through the same code paths as `add_refernce` in the future, so we don't duplicate default values. Fixes #25169
-
- 31 5月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up of #20815. ```ruby class CreatePeople < ActiveRecord::Migration[5.0] def change create_table :people do |t| t.integer :int t.bigint :bint t.text :txt t.binary :bin end end end ``` Result. In postgresql and sqlite3 adapters: ```ruby ActiveRecord::Schema.define(version: 20160531141018) do create_table "people", force: :cascade do |t| t.integer "int" t.bigint "bint" t.text "txt" t.binary "bin" end end ``` In mysql2 adapter: ```ruby ActiveRecord::Schema.define(version: 20160531141018) do create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| t.integer "int" t.bigint "bint" t.text "txt", limit: 65535 t.binary "bin", limit: 65535 end end ``` After this patch: ```ruby ActiveRecord::Schema.define(version: 20160531141018) do create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| t.integer "int" t.bigint "bint" t.text "txt" t.binary "bin" end end ```
-