- 20 9月, 2018 9 次提交
-
-
由 Vitor Oliveira 提交于
-
由 Ryuta Kamizono 提交于
Make `ActiveRecord::Result#to_a` as alias to `ActiveRecord::Result#to_ary`
-
由 bogdanvlviv 提交于
`ActiveRecord::Result#to_a` was introduced in #33912. I would prefer to make `to_a` as alias to the `to_ary` because: - It would be clear for users from https://edgeapi.rubyonrails.org/classes/ActiveRecord/Result.html that `to_a` and `to_ary` are the same - For us it would take less efforts in case if we needed to change the docs or implementation, since the methods are the same Follow up #33912
-
由 Ryuta Kamizono 提交于
Don't update counter cache unless the record is actually saved
-
由 Rafael França 提交于
Deprecate ActiveRecord::Result#to_hash in favor of #to_a
-
由 yuuji.yaginuma 提交于
When using environment specific credentials, `RAILS_MASTER_KEY` is not used.
-
由 Yuji Yaginuma 提交于
Add CSP nonce to `style-src` directive
-
由 Wojciech Wnętrzak 提交于
For `production` environment look first for `config/credentials/production.yml.enc` file that can be decrypted by `ENV["RAILS_MASTER_KEY"]` or `config/credentials/production.key` master key. Edit given environment credentials file by command `rails credentials:edit --environment production`. Default behavior can be overwritten by setting `config.credentials.content_path` and `config.credentials.key_path`.
-
由 Rafael Mendonça França 提交于
When you pass an empty array to find we know we shoudl return an empty array but it is surprising that we are returning the original empty array instead of a new one.
-
- 19 9月, 2018 4 次提交
-
-
由 Kevin Cheng 提交于
method returns an array of hashes, not a hash e.g. Hash.try_convert(result) calls #to_hash and raises a TypeError [Gannon McGibbon + Kevin Cheng]
-
由 Ryuta Kamizono 提交于
This is a 4th attempt to make counter cache transactional completely. Past attempts: #9236, #14849, #23357. All existing counter cache issues (increment/decrement twice, lost increment) are caused due to updating counter cache on the outside of the record saving transaction by assigning belongs_to record, even though assigning that doesn't cause the record saving. We have the `@_after_replace_counter_called` guard condition to mitigate double increment/decrement issues, but we can't completely prevent that inconsistency as long as updating counter cache on the outside of the transaction, since saving the record is not always happened after that. We already have handling counter cache after create/update/destroy, https://github.com/rails/rails/blob/1b90f614b1b3d06b7f02a8b9ea6cd84f15d58643/activerecord/lib/active_record/counter_cache.rb#L162-L189 https://github.com/rails/rails/blob/1b90f614b1b3d06b7f02a8b9ea6cd84f15d58643/activerecord/lib/active_record/associations/builder/belongs_to.rb#L33-L59 so just removing assigning logic on the belongs_to association makes counter cache transactional completely. Closes #14849. Closes #23357. Closes #31493. Closes #31494. Closes #32372. Closes #33113. Closes #33117 Closes #33129. Closes #33458.
-
由 Rafael França 提交于
Follow up #33751
-
由 Ryuta Kamizono 提交于
`topic` and `reply` belongs_to associations on `SillyReply` are defined with the same `foreign_key` (`parent_id`) and `counter_cache` (`replies_count`) columns. This would cause unintentional side-effect (e.g. saving `SillyReply` object would cause double increment `replies_count`), so it is better to avoid that side-effect.
-
- 18 9月, 2018 2 次提交
-
-
由 Matthew Draper 提交于
Fix a typo in AR Query Interface [ci skip]
-
由 Andrew 提交于
-
- 17 9月, 2018 10 次提交
-
-
由 Ryuta Kamizono 提交于
Fix deprecation warning of `ActiveRecord::Migrator.migrations_path=`
-
由 Ryuta Kamizono 提交于
`ActiveRecord::MigrationContext.new` just create an instance, doesn't have any side-effect.
-
由 Ryuta Kamizono 提交于
Improve readability in form helpers guide [ci skip]
-
由 tkoyama1988 提交于
-
由 bogdanvlviv 提交于
`ActiveRecord::Migrator.migrations_path=` was deprecated in #31727. This commit fixes: - `ActiveRecord::Migrator.migrations_path=` is deprecated, but not `ActiveRecord::Migrator.migrations_paths=` - Adds missing space The warning including this commit: ``` DEPRECATION WARNING: `ActiveRecord::Migrator.migrations_path=` is now deprecated and will be removed in Rails 6.0. You can set the `migrations_paths` on the `connection` instead through the `database.yml`. ``` Since it was deprecated in Rails 5.2 we should backport it to the `5-2-stable` branch. Related to #31727
-
由 Ryuta Kamizono 提交于
Print correct rake command on running AJ integration tests
-
由 bogdanvlviv 提交于
Currently when executing `bundle exec rake test:integration` under `activejob/` derectory, it prints helpful info like: ``` (snip) *** rake aj:integration:async *** (snip) *** rake aj:integration:delayed_job *** (snip) ``` but there is no defined `:aj` scope in `activejob/Rakefile`, so I think output should be like: ``` (snip) *** rake test:integration:async *** (snip) *** rake test:integration:delayed_job *** (snip) ``` By the way `rake test:integration` doesn't work if execute it without prepending `bundle exec` to that command. It is probably what we should fix too.
-
由 George Claghorn 提交于
Raise `ActiveRecord::InvalidForeignKey` in `before_destroy` for a blob if attachments exist
-
由 Yuji Yaginuma 提交于
PostgreSQL: prepare for pg-1.1
-
由 bogdanvlviv 提交于
The issue #32584 was fixed in #33405 by adding foreign key constraint to the `active_storage_attachments` table for blobs. This commit implements fix on app-level in order to ensure that users can't delete a blob with attachments even if they don't have the foreign key constraint. See a related discussion in the Campfire: https://3.basecamp.com/3076981/buckets/24956/chats/12416418@1236718899 Note that, we should backport it to `5-2-stable` too. Related to #33405
-
- 16 9月, 2018 9 次提交
-
-
由 bogdanvlviv 提交于
Also this commit removes `:wait` from payload of `retry_stopped.active_job`. Related to https://github.com/rails/rails/pull/33751#discussion_r214140008 Follow up #33751 /cc @kaspth, @rafaelfranca
-
由 bogdanvlviv 提交于
Add mention about it to the "Active Support Instrumentation" guide Related to https://github.com/rails/rails/pull/33751#discussion_r214745153 Follow up #33751
-
由 Ryuta Kamizono 提交于
ActiveRecord::Associations::Preloader should preload all instances of the same record
-
由 Nikita Sokolov 提交于
-
由 Yuji Yaginuma 提交于
Fix av-ujs build
-
由 yuuji.yaginuma 提交于
The bin shim provides by `chromedriver-helper` gem has renamed to `chromedriver-helper` since 2.0. https://github.com/flavorjones/chromedriver-helper/pull/58 Since bin of new name is set to driver path in `lib/chromedriver-helper.rb`, need to load it.
-
由 yuuji.yaginuma 提交于
-
由 Ryuta Kamizono 提交于
MySQL supports JOINs to UPDATE, so if column name isn't qualified by table name, it would cause an ambiguous error: ``` Mysql2::Error: Column 'integer' in field list is ambiguous: UPDATE `pets` INNER JOIN `toys` ON `toys`.`pet_id` = `pets`.`pet_id` SET `integer` = COALESCE(`integer`, 0) + 1 WHERE `toys`.`name` = ? ```
-
由 Ryuta Kamizono 提交于
`persistence_test.rb` and `relations_test.rb` have too many lines, so I'd like to extract relation around tests to dedicated files before newly test added.
-
- 15 9月, 2018 6 次提交
-
-
由 yuuji.yaginuma 提交于
Get a warning about `async_exec`, but it seems that build has passed through the fix of https://bitbucket.org/ged/ruby-pg/commits/be48d118eeedbf6b6a1f0aa14749ab97fc22065c.
-
由 George Claghorn 提交于
-
由 Ryuta Kamizono 提交于
Fallback to unprepared statement only when bind params limit is exceeded
-
由 yuuji.yaginuma 提交于
Follow up #33883.
-
由 George Claghorn 提交于
Configure Active Storage route prefix
-
由 Lucas Brandt 提交于
* Update association_basics.md [ci skip] Addresses issue #33599 * Update associations.rb API documentation [ci skip] Additional detail for documentation of `belongs_to` `association=(associate)` * Update association_basics.md [ci skip] Reverts misplaced documentation comment
-