- 29 10月, 2016 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 27 10月, 2016 3 次提交
-
-
由 Mehmet Emin İNAÇ 提交于
Using Constant and symbol class_name option for associations are valid but raises exception on HABTM associations. There was a test case which tries to cover symbol class_name usage but doesn't cover correctly. Fixed both symbol usage and constant usage as well. These are all working as expected now; ``` has_and_belongs_to_many :foos, class_name: 'Foo' has_and_belongs_to_many :foos, class_name: :Foo has_and_belongs_to_many :foos, class_name: Foo ``` Closes #23767
-
由 Xavier Noria 提交于
Regexp#match? should be considered to be part of the Ruby core library. We are emulating it for < 2.4, but not having to require the extension is part of the illusion of the emulation.
-
由 Samuel Cochran 提交于
This executor currently relies on `ActiveRecord::Base.connection` not changing between `prepare` and `complete`. If something else returns the current ActiveRecord connection to the pool early then this `complete` call will fail to clear the correct query cache and restore the original `query_cache_enabled` status. This has for example been happening in Sidekiq: https://github.com/mperham/sidekiq/pull/3166 We can just keep track of the connection as part of the exector state.
-
- 26 10月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up to 99cf7558.
-
- 23 10月, 2016 3 次提交
-
-
由 Prathamesh Sonpatki 提交于
- These tests were fixed earlier on master in https://github.com/rails/rails/commit/f13ec72664fd13d33d617103ca964a7592295854. - They started failing in first place due to change in https://github.com/brianmario/mysql2/commit/f14023fcfee9e85e6fc1b0e568048811518f8c23. - They will fail again when the message is changed in mysql2 so let's not rely on the error message.
-
由 Sean Griffin 提交于
This reverts commit 671eb742. This is not a change we would like moving forward.
-
由 Guillermo Iguaran 提交于
-
- 22 10月, 2016 3 次提交
-
-
由 Prathamesh Sonpatki 提交于
- CollectionAssociation#select was removed in https://github.com/rails/rails/pull/25989 in favor of QueryMethods#select but it caused a regression when passing arguments to select and a block. - This used to work earlier in Rails 4.2 and Rails 5. See gist https://gist.github.com/prathamesh-sonpatki/a7df922273473a77dfbc742a4be4b618. - This commit restores the behavior of Rails 4.2 and Rails 5.0.0 to allow passing arguments and block at the same time but also deprecates it. - Because, these arguments do not have any effect on the output of select when select is used with a block. - Updated documentation to remove the example passing arguments and block at the same time to `CollectionProxy#select`.
-
由 bogdanvlviv 提交于
-
由 bogdanvlviv 提交于
-
- 21 10月, 2016 1 次提交
-
-
由 Aaron Patterson 提交于
Query cache doesn't type cast bind parameters since it isn't actually querying the database, so it can't pass those values in. Type casting in the query cache method would cause the values to be type cast twice in the case that there is a cache miss (since the methods it calls will type cast *again*). If logging is disabled, then adding the type cast code to the query cache method will needlessly typecast the values (since the only reason those values are type cast is for display in the logs). Fixes #26828.
-
- 14 10月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
If does not quote table name properly, invalid SQL is generated.
-
- 12 10月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
``` test/cases/adapters/postgresql/case_insensitive_test.rb:12: warning: ambiguous first argument; put parentheses or a space even after `/' operator test/cases/adapters/postgresql/case_insensitive_test.rb:16: warning: ambiguous first argument; put parentheses or a space even after `/' operator test/cases/adapters/postgresql/case_insensitive_test.rb:20: warning: ambiguous first argument; put parentheses or a space even after `/' operator test/cases/adapters/postgresql/case_insensitive_test.rb:24: warning: ambiguous first argument; put parentheses or a space even after `/' operator ```
-
- 11 10月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up to #26735. If `table_options` returns `{ comment: nil }`, `create_table` line is broken. Example: ```ruby create_table "accounts", force: :cascade, do |t| ```
-
- 10 10月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
```ruby # Before t.index ["firm_id", "type", "rating"], name: "company_index", order: {"rating"=>:desc}, using: :btree # After t.index ["firm_id", "type", "rating"], name: "company_index", order: { rating: :desc }, using: :btree ```
-
- 08 10月, 2016 2 次提交
-
-
-
由 Matthew Draper 提交于
-
- 07 10月, 2016 1 次提交
-
-
由 Matthew Draper 提交于
-
- 03 10月, 2016 2 次提交
-
-
由 Iain Beeston 提交于
ActiveModel::Type) Some code was previously referring to ActiveModel::Type::*. This could cause issues in the future if any of the ActiveRecord::Type classes were overridden in the future.
-
由 Ryuta Kamizono 提交于
Currently all adapters (postgresql, mysql2, sqlite3, oracle-enhanced, and sqlserver) implemented `indexes` and schema dumper expects implemented `indexes`. https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/schema_dumper.rb#L208 Therefore `respond_to?(:indexes)` checking is unnecessary.
-
- 01 10月, 2016 1 次提交
-
-
由 Matthew Draper 提交于
We've seen occasional Travis failures mentioning deadlocks. I think they're escaping from this test.
-
- 30 9月, 2016 1 次提交
-
-
由 Sean Griffin 提交于
This was caused by 6d0d83a3. While the bug it's trying to fix is handled if the association is loaded in an after_(create|save) callback, it doesn't handle any cases that load the association before the persistence takes place (validation, or before_* filters). Instead of caring about the timing of persistence, we can just ensure that we're not double adding the record instead. The test from that commit actually broke, but it was not because the bug has been re-introduced. It was because `Bulb` in our test suite is doing funky things that look like STI but isn't STI, so equality comparison didn't happen as the loaded model was of a different class. Fixes #26661.
-
- 27 9月, 2016 2 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
`test_native_decimal_insert_manual_vs_automatic` exists inside `unless current_adapter?(:SQLite3Adapter)`. This condition is duplicated.
-
- 24 9月, 2016 1 次提交
-
-
由 Trung Duc Tran 提交于
Test: JSON attribute value nil can be used in where(attr: nil) Add changelog entry
-
- 23 9月, 2016 1 次提交
-
-
由 Prathamesh Sonpatki 提交于
- If the attribute is not changed, then update_attribute does not run SQL query, this effectively means that no change was made to the attribute. - This change was made in https://github.com/rails/rails/commit/0fcd4cf5 to avoid a SQL call. - But the change resulted into `nil` being returned when there was no change in the attribute value. - This commit corrects the behavior to return true if there is no change in attribute value. This is same as previous behavior of Rails 4.2 plus benefit of no additional SQL call. - Fixes #26593.
-
- 22 9月, 2016 1 次提交
-
-
由 Jean Boussier 提交于
-
- 20 9月, 2016 1 次提交
-
-
由 Rafael Mendonça França 提交于
When the association is autosaved we were storing the details with string keys. This was creating inconsistency with other details that are added using the `Errors#add` method. It was also inconsistent with the `Errors#messages` storage. To fix this inconsistency we are always storing with symbols. This will cause a small breaking change because in those cases the details could be accessed as strings keys but now it can not. The reason that we chose to do this breaking change is because `#details` should be considered a low level object like `#messages` is. Fix #26499. [Rafael Mendonça França + Marcus Vieira]
-
- 17 9月, 2016 1 次提交
-
-
由 Michael Grosser 提交于
assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
-
- 14 9月, 2016 3 次提交
-
-
由 Jakob Skjerning 提交于
Without this the changes to the lock version column will stick around even after `touch` returns. Before: model.touch model.changes # => {"lock_version"=>[0, "1"]} After: model.touch model.changes # {}
-
由 Ryuta Kamizono 提交于
All indentation was normalized by rubocop auto-correct at 80e66cc4. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
-
由 Yasuo Honda 提交于
-
- 12 9月, 2016 2 次提交
-
-
由 Yosuke Kabuto 提交于
Make name of attribute medium instead of normal
-
由 yuuji.yaginuma 提交于
If using namespaced fixtures, get following Ruby warning. ``` activerecord/lib/active_record/fixtures.rb:922: warning: method redefined; discarding old admin_foos activerecord/lib/active_record/fixtures.rb:922: warning: previous definition of admin_foos was here ``` This is happening because of the multiple set the same path when setting the fixture name. Fix to remove the duplicate path.
-
- 11 9月, 2016 3 次提交
-
-
由 Ryuta Kamizono 提交于
The `elsif` branch is completely duplicated with `else` branch.
-
由 Ryuta Kamizono 提交于
Passing `FakeColumn` was removed at #15336 therefore `test_string_with_crazy_column` is duplicated with `test_quote_string_no_column`.
-
由 Ryuta Kamizono 提交于
`Mutex` was removed at 8eb7561a.
-
- 08 9月, 2016 2 次提交
-
-
由 Dylan Thacker-Smith 提交于
By doing `@connection = nil` that means that we need nil checks before it is used anywhere, but we weren't doing those checks. Instead, we get a NoMethodError after using a connection after it fails to reconnect. Neither of the other adapters set @connection to nil, just the mysql2 adapter. By just closing it, we avoid the need to check if we have a connection object and it will produce an appropriate exception when used.
-
由 Prathamesh Sonpatki 提交于
- When the named timestamp column is nil, we should just return the cache_key with model name and id similar to the behavior of implicit timestamp columns. - Fixed one of the issue mentioned in https://github.com/rails/rails/issues/26417.
-