- 06 11月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
A relation includes `klass`, so it can not be used as it is if current class is different from `current_scope.klass`. It should be created new relation by current class to respect the klass and STI constraint. Fixes #17603. Fixes #23576.
-
- 13 8月, 2017 1 次提交
-
- 20 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 18 7月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Since 5c71000d, it has lost to be able to unscope `default_scope` in STI associations. This change will use `.empty_scope?` instead of `.values.empty?` to regard as an empty scope if only have `type_condition`.
-
- 17 7月, 2017 2 次提交
-
-
由 Sean Griffin 提交于
This change was introduced by #18109. The intent of that change was to specifically apply `unscoped`, not to allow all changes to `current_scope` to affect the join. The idea of allowing `current_scope` to affect joins is interesting and potentially more consistent, but has sever problems associated with it. The fact that we're specifically stripping out joins indicates one such problem (and potentially leads to invalid queries). Ultimately it's difficult to reason about what `Posts.joins(:users)` actually means if it's affected by `User.current_scope`, and it's difficult to specifically control what does or doesn't get added. If we were starting from scratch, I don't think I'd have `joins` be affected by `default_scope` either, but that's too big of a breaking change to make at this point. With this change, we no longer apply `current_scope` when bringing in joins, with the singular exception of the motivating use case which introduced this bug, which is providing a way to *opt-out* of having the default scope apply to joins. Fixes #29338.
-
由 Ryuta Kamizono 提交于
We have some indentation cops. But now there is a little inconsistent params indentations. Enable `Layout/FirstParameterIndentation` cop to prevent newly inconsistent indentation added and auto-correct to existing violations.
-
- 16 7月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
This is related with #27680. Since `where_values_hash` keys constructed by `where` are string, so we need `stringify_keys` to `create_with_value` before merging it.
-
- 02 7月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
This reverts commit 3420a145, reversing changes made to afb66a5a.
-
- 01 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 29 6月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
This regression was caused by #23004. If STI subclass is using scoping in parent class scoping, `current_scope` in subclass is never restored. I fixed to restore `current_scope` to previous value correctly.
-
- 01 6月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 24 5月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up of #25702.
-
- 13 5月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
`DefaultScopingWithThreadTest` expects that there are two or more of `developers` data, but have not created data in the test. Therefore, tests may fail depending on execution order.
-
- 27 4月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
This change reverted in eac6f369 but it is needed for data integrity. See #25328.
-
由 Rafael Mendonça França 提交于
Revert "Merge pull request #27636 from mtsmfm/disable-referential-integrity-without-superuser-privilege-take-2" This reverts commit c1faca63, reversing changes made to 8c658a0e. See https://github.com/rails/rails/pull/27636#issuecomment-297534129
-
- 31 3月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
-
- 26 3月, 2017 1 次提交
-
-
由 Fumiaki MATSUSHIMA 提交于
Re-create https://github.com/rails/rails/pull/21233 eeac6151 was reverted (127509c0) because it breaks tests. ---------------- ref: 72c15572 - We must use `authors` fixture with `author_addresses` because of its foreign key constraint. - Tests require PostgreSQL >= 9.4.2 because it had a bug about `ALTER CONSTRAINTS` and fixed in 9.4.2.
-
- 19 3月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Since b644964b `ActiveRecord::Relation` includes `Enumerable` so delegating `collect`, `all?`, and `include?` are also unneeded. `collect` without block returns `Enumerable` without preloading by that. We should use `load` rather than `collect` for force loading.
-
- 15 3月, 2017 1 次提交
-
-
由 Fumiaki MATSUSHIMA 提交于
If we run only following tests: - test/cases/scoping/default_scoping_test.rb - test/cases/associations_test.rb ``` $ cat Rakefile.test require "rake/testtask" ENV["ARCONN"] = "postgresql" Rake::TestTask.new do |t| t.libs << "test" t.test_files = %w( test/cases/scoping/default_scoping_test.rb test/cases/associations_test.rb ) end ``` a test will fail: ``` $ bundle exec rake test -f Rakefile.test /app/activesupport/lib/active_support/core_ext/enumerable.rb:20: warning: method redefined; discarding old sum Using postgresql Run options: --seed 11830 # Running: .........................................................................................F................ Finished in 6.939055s, 15.2759 runs/s, 27.9577 assertions/s. 1) Failure: AssociationProxyTest#test_save_on_parent_saves_children [/app/activerecord/test/cases/associations_test.rb:185]: Expected: 1 Actual: 2 106 runs, 194 assertions, 1 failures, 0 errors, 0 skips rake aborted! Command failed with status (1) /usr/local/bin/bundle:22:in `load' /usr/local/bin/bundle:22:in `<main>' Tasks: TOP => test (See full trace by running task with --trace) ``` In #28083, change `self.use_transactional_tests` to `false` but we forget to clean-up fixture. However we don't have to disable transaction except a few tests.
-
- 25 2月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
-
- 21 2月, 2017 1 次提交
-
-
由 eileencodes 提交于
This ensures multiple threads inside a transactional test to see consistent database state. When a system test starts Puma spins up one thread and Capybara spins up another thread. Because of this when tests are run the database cannot see what was inserted into the database on teardown. This is because there are two threads using two different connections. This change uses the statement cache to lock the threads to using a single connection ID instead of each not being able to see each other. This code only runs in the fixture setup and teardown so it does not affect real production databases. When a transaction is opened we set `lock_thread` to `Thread.current` so we can keep track of which connection the thread is using. When we rollback the transaction we unlock the thread and then there will be no left-over data in the database because the transaction will roll back the correct connections. [ Eileen M. Uchitelle, Matthew Draper ]
-
- 04 1月, 2017 1 次提交
-
-
由 Rafael Mendonça França 提交于
Revert "Merge pull request #21233 from mtsmfm/disable-referential-integrity-without-superuser-privileges" This reverts commit eeac6151, reversing changes made to 5c40239d. Reason: Broke the isolated tests. https://travis-ci.org/rails/rails/builds/188721346
-
- 02 1月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
-
- 25 12月, 2016 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 03 12月, 2016 1 次提交
-
-
由 Fumiaki MATSUSHIMA 提交于
ref: 72c15572 - We must use `authors` fixture with `author_addresses` because of its foreign key constraint. - Tests require PostgreSQL >= 9.4.2 because it had a bug about `ALTER CONSTRAINTS` and fixed in 9.4.2.
-
- 29 10月, 2016 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 27 10月, 2016 1 次提交
-
-
由 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.
-
- 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
-
- 16 8月, 2016 1 次提交
-
-
由 Rafael Mendonça França 提交于
Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
-
- 12 8月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 08 8月, 2016 1 次提交
-
-
由 Yasuo Honda 提交于
also test `ROWNUM <=` for Oracle 11g or older version of Oracle and Oracle visitor Oracle 12c database and Arel Oracle12 visitor supports better top N query.
-
- 07 8月, 2016 3 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
-
- 28 7月, 2016 1 次提交
-
-
由 Takashi Kokubun 提交于
Fixes #25653.
-
- 25 7月, 2016 1 次提交
-
-
由 Xavier Noria 提交于
-
- 24 7月, 2016 1 次提交
-
-
由 Xavier Noria 提交于
Where appropriatei, prefer the more concise Regexp#match?, String#include?, String#start_with?, or String#end_with?
-
- 19 7月, 2016 1 次提交
-
-
由 suginoy 提交于
Changing the order of method chaining `merge` and other query method such as `joins` should produce the same result. ```ruby class Topic < ApplicationRecord scope :safe_chaininig, -> { joins(:comments).merge(Comment.newest) } scope :unsafe_chaininig, -> { merge(Comment.newest).joins(:comments) } #=> NoMethodError end ```
-
- 05 5月, 2016 1 次提交
-
-
由 Joe Rafaniello 提交于
[ci skip]
-