- 18 5月, 2020 19 次提交
-
-
由 Ryuta Kamizono 提交于
Related #39236. `relation.merge` method sometimes replaces mergee side condition, but sometimes maintain both conditions unless `relation.rewhere` is used. It is very hard to predict merging result whether mergee side condition will be replaced or not. One existing way is to use `relation.rewhere` for merger side relation, but it is also hard to predict a relation will be used for `merge` in advance, except one-time relation for `merge`. To address that issue, I propose to support merging option `:rewhere`, to allow mergee side condition to be replaced exactly. That option will allow non-`rewhere` relation behaves as `rewhere`d relation. ```ruby david_and_mary = Author.where(id: david.id..mary.id) # both conflict conditions exists david_and_mary.merge(Author.where(id: bob)) # => [] # mergee side condition is replaced by rewhere david_and_mary.merge(Author.rewhere(id: bob)) # => [bob] # mergee side condition is replaced by rewhere option david_and_mary.merge(Author.where(id: bob), rewhere: true) # => [bob] ```
-
由 Ryuta Kamizono 提交于
Fix update with dirty locking column to not match latest object accidentally
-
由 Ryuta Kamizono 提交于
Fix rename column in bulk alter table for PostgreSQL
-
由 Ryuta Kamizono 提交于
PostgreSQL doesn't support rename column operation in bulk alter table. Fixes #39322.
-
由 Ryuta Kamizono 提交于
Related #32163. We should not identify an object by dirty value. If do so, accidentally matches latest object even though it is a stale object.
-
由 John Hawthorn 提交于
Skip interpolated strings in AV::Digestor
-
由 Ryuta Kamizono 提交于
Unless explicitly intend to behave it differently from the superclass.
-
由 Ryuta Kamizono 提交于
-
由 Aaron Patterson 提交于
Use DidYouMean for AssociationNotFoundError
-
由 Ryuta Kamizono 提交于
-
由 John Hawthorn 提交于
-
由 Eugene Kenny 提交于
Avoid allocating extra hash and arrays when as_json is called without options
-
由 fatkodima 提交于
Co-authored-by: NEugene Kenny <elkenny@gmail.com>
-
由 Petrik 提交于
If an association isn't found we can suggest matching associations: ``` Post.all.merge!(includes: :monkeys).find(6) Association named 'monkeys' was not found on Post; perhaps you misspelled it? Did you mean? funky_tags comments images skimmers ```
-
由 Ryuta Kamizono 提交于
In aggregation value's type cast, `klass.attribute_types.fetch(...)` will find no type almost all cases, since any type is already returned by `column.type_caster` in that case. And also, the root of join dependency tree is also the model's `klass`, so the explicit `klass.attribute_types` is redundant originally.
-
由 David Heinemeier Hansson 提交于
Add support for finding records based on signed ids, which are tamper-proof, verified ids that can be set to expire and scoped with a purpose. This is particularly useful for things like password reset or email verification, where you want the bearer of the signed id to be able to interact with the underlying record, but usually only within a certain time period.
-
由 Ryuta Kamizono 提交于
Otherwise `@_defer_touch_attrs` is touched again with old `@_touch_time` in `before_committed!`.
-
由 Vinicius Stock 提交于
* Use app:binstub:yarn in Action Text install generator
-
由 Ryuta Kamizono 提交于
Remove `sync_with_transaction_state` to simplify code base
-
- 17 5月, 2020 12 次提交
-
-
由 David Heinemeier Hansson 提交于
* Add default ENV variable option with BACKTRACE to turn off backtrace cleaning when debugging framework code * Use runner as the example Although I think we should consider dropping -b in tests and just relying on this more general option for sidestepping the backtrace cleaner.
-
由 Ryuta Kamizono 提交于
This also removes the `if @transaction_state&.finalized?` guard which is harder to understand optimization introduced at #36049. The guard is faster enough though, but removing that will make attribute access about 2% ~ 4% faster, and will make code base to ease to maintain. `sync_with_transaction_state` was introduced at #9068 to address memory bloat when creating lots of AR objects inside a transaction. I've found #18638 the same design of this to address memory bloat, but this differs from #18638 in that it will allocate one `WeakMap` object only when explicit transaction, no extra allocation for implicit transaction. Executable script to reproduce memory bloat: https://gist.github.com/kamipo/36d869fff81cf878658adc26ee38ea1b https://github.com/rails/rails/issues/15549#issuecomment-46035848 I can see no memory concern with this. Co-authored-by: NArthur Neves <arthurnn@gmail.com>
-
由 Ryuta Kamizono 提交于
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
Co-authored-by: NHaroon Ahmed <haroon.ahmed25@gmail.com>
-
由 Edouard Chin 提交于
In beb7fba6, I forgot to add a branch in the case where an application uses AR (and thus it responds to `fixture_path`) to return a path relative to `file_fixture_path`. Closes #39278.
-
由 Kasper Timm Hansen 提交于
Don't load app environment when running encrypted commands
-
由 Kasper Timm Hansen 提交于
Replace Hash#delete_if with Hash#compact
-
由 Eugene Kenny 提交于
Return enumerator from ActionController::Parameters' each_pair and each_value methods
-
由 David Heinemeier Hansson 提交于
-
由 fatkodima 提交于
-
由 Matthew Draper 提交于
Allow the construction of a CTE from an Arel::Table
-
- 16 5月, 2020 9 次提交
-
-
由 Ryuta Kamizono 提交于
Fix eager load with Arel joins to maintain the original joins order
-
由 Ryuta Kamizono 提交于
Fix group by count with eager loading + order + limit/offset
-
由 Aaron Patterson 提交于
Fixed BacktraceCleaner to never return an empty backtrace.
-
由 Jonathan Hefner 提交于
Update Rails Internationalization (I18n) API Guide [ci skip]
-
由 David Auza 提交于
Symbols that contained dashes were replaced with the right syntax. For example: :en-GB was replaced by :"en-GB" Co-authored-by: NJonathan Hefner <jonathan@hefner.pro>
-
由 Ryuta Kamizono 提交于
#38354 is caused by #36304, to fix invalid joins order for through associations. Actually passing Arel joins to `joins` is not officially supported unlike string joins, and also Arel joins could be easily converted to string joins by `to_sql`. But I'd not intend to break existing apps without deprecation cycle, so I've changed to mark only implicit joins as leading joins, to maintain the original joins order for user supplied Arel joins. Fixes #38354.
-
由 Ryan Davis 提交于
I'm not sure about this one. The gist is, minitest's UnexpectedError#message includes a backtrace but the reporter tests here expect there not to be one in inline output. Personally, I think that's wrong as it removes information you'd want to debug, but this might be a philosophical difference with the rails test ethos... or it might just be aesthetic. I am happy to back out this change and fix the tests if you'd rather.
-
由 Ryan Davis 提交于
Happy to squash this before merge. Just separate so I can whittle these down. Most of the problem seems to be centered around the backtrace filter being both for general use and for minitest... and I'm only aware of / addressing minitest issues. If they really need to be separate, then we can make a separate one for minitest.
-
由 Ryan Davis 提交于
Empty backtraces means you didn't run any code, which isn't the case, and goes against the contract that Minitest.backtrace_cleaner expects. This fixes a bug I've seen in a number of reports. It would be nice if this got backported to whatever versions are active, as this keeps coming back on minitest issues.
-