なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2024/04/26)

2024/04/26分のコミットです。

CHANGELOGへの追加はありませんでした。


Skip selenium-webdriver version 4.20.0

Gemfileの修正です。

selenium-webdriver 4.20.0を使用しないよう修正しています。4.20.0でpublic APIが誤って消されてしまいRailsのテストがエラーになるため。


Fix Rake :preview_docs tarball

Rakefileの修正です。

docのpreviewのtarballを作成するRakeタスクが正しく動作してなかったのを修正しています。


Resolve deprecation warning in latest selenium-webdriver

actionpack/lib/action_dispatch/system_testing/browser.rbの修正です。

deprecatedになったselenium-webdriver gemのSelenium::WebDriver::DriverFinder#driver_pathメソッドを使用しないよう修正しています。

rails commit log流し読み(2024/04/25)

2024/04/25分のコミットです。

CHANGELOGへの追加はありませんでした。


Merge pull request #51653 from Earlopain/fixup-51619

activesupport/test/deprecation_test.rbの修正です。

Ruby 3.4のinternal frameをfilterする挙動のテストがfailしていたのを修正しています。


Add more gem docs in Rails Application Templates guide

rails guideのRails Application Templatesの修正です。

gem(*args)メソッドについて説明している箇所に、gemのバージョンを指定する方法についての説明を追加しています。

rails commit log流し読み(2024/04/24)

2024/04/24分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

actionpack/CHANGELOG.md


Fix PostgreSQL Cidr#change? when changed address prefix. Fix #51582

activerecord/lib/active_record/connection_adapters/postgresql/oid/cidr.rbの修正です。

PostgreSQLでCIDR columnを使用している場合に、netmaskの値だけを更新した場合に、値を更新したと見なされないバグがあったのを修正しています。


Document the use of nopush for asset tags

actionview/lib/action_view/helpers/asset_tag_helper.rbのdocの修正です。

javascript_include_tagメソッド、及び、stylesheet_link_tagメソッドのdocに:nopushオプションについての説明を追加しています。


Merge pull request #51616 from notchairmk/notchairmk/accept-params

actionpack/lib/action_dispatch/http/mime_type.rbの修正です。

Mime::Type.parseにtype parameterが指定された値(e.g. q=0.8,image/png)を指定した場合にエラーになってしまうバグがあったのを修正しています。


Merge pull request #51619 from Earlopain/ruby-3.4-backtraces

activesupport/lib/active_support/deprecation/reporting.rbの修正です。

ActiveSupport::Deprecation::Reportingでcallstackのfilter処理をする際に、Ruby 3.4で追加されたinternal framesをfilterするよう修正しています。


Use Ruby's official documentation

docの修正です。

Ruby本体に関するdocのリンクをruby-doc.orgからdocs.ruby-lang.orgに変更しています。


Upgrade devcontainer to use 3.3.1

.devcontainer/Dockerfileの修正です。

devcontainerで使用するRubyのバージョンを3.3.1に更新しています。


Remove outdated comment

activesupport/lib/active_support/duration/iso8601_serializer.rbのdocの修正です。

ActiveSupport::Duration::ISO8601Serializer#normalizeメソッドのdocから古い挙動に関する説明を削除しています。


Merge pull request #51446 from koic/fix_error_when_rails_g_rubocop_with_pretend

railties/lib/rails/configuration.rbの修正です。

generatorに--pretendオプションを指定していた場合に、Rubocopのapply処理でエラーになってしまうバグがあったのを修正しています。


Merge pull request #51650 from zzak/guides-process_scss-dir

Rakefileguides/rails_guides/generator.rbの修正です

./guidesディレクトリの外側でguideのbuildを実行した際にエラーになってしまっていたのを修正しています。

rails commit log流し読み(2024/04/23)

2024/04/23分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activesupport/CHANGELOG.md


Deprecate ActiveSupport::ProxyObject

activesupport/lib/active_support/proxy_object.rbの修正です。

ActiveSupport::ProxyObjectをdeprecatedにしています。Ruby本体のBasicObjectが無かった頃に必要だったクラスで、現在はBasicObjectを使えばよくなっているため。


Let Action Cable's autoloader ignore the version file

actioncable/lib/action_cable.rbの修正です。

Action Cable用のautoloaderでversion.rbをignoreするよう修正しています。version.rbgem_version.rbに依存している、かつ、gem_version.rbは既にignoreされており、version.rbだけ単体でロードされても動作しないため。


Use Module#include rather than prepend since we don't need prepend semantics here and include leads to faster method lookups.

activesupport/lib/active_support/core_ext/numeric/conversions.rbactivesupport/lib/active_support/core_ext/object/json.rbの修正です。

Module#prependを使っている箇所で、Module#includeで良い箇所についてはModule#includeを使用するよう修正しています。Module#includeの方がmethod lookupが速いため。


Fix ActionView backtrace filtering on Ruby 3.4+

railties/lib/rails/backtrace_cleaner.rbの修正です。

backtraceのfilter処理で、Ruby 3.4で変更になったbacktraceのフォーマット(backtickを使用しないよう修正)をサポートするよう修正しています。


Merge pull request #51271 from sato11/enable-compact-blank

activesupport/lib/active_support/log_subscriber.rbの修正です。

不足していたrequireを追加しています。


Merge pull request #50780 from zachasme/app-update-skip-sprockets

railties/lib/rails/app_updater.rbの修正です。

app:updateを実行する際に、Sprocketsが使われているかPropshaftが使われているかどうかをチェックし、生成するファイルを変更するよう修正しています。


Ensure pre-7.1 migrations use legacy index names when using rename_table

Active Recordの修正です。

Rails 7.1より前で作られたmigrationファイル内でrename_tableを使っていた場合に、rename_tableで作られるindex名がRails 7.1で対応された新しいindex名になってしまうバグがあったのを修正しています。


Support hexBinary format in XML

activesupport/lib/active_support/xml_mini.rbの修正です。

ActiveSupport::XmlMinihexBinaryエンコードされたファイルのパースをサポートするよう修正しています。


Rename method to keep it consistent with others parse* versions

activesupport/lib/active_support/xml_mini.rbの修正です。

hexBinary用のパースメソッドのメソッド名を_からはじめるよう修正しています。他のメソッド名と名前を合わせる為。


Merge pull request #51635 from silva96/patch-2

railties/lib/rails/generators/migration.rbのdocの修正です。

Rails::Generators::Migration moduleのdocについて、フォーマットや言い回しの修正を行っています。


Join association built from string join should not retry

activerecord/lib/active_record/associations/join_dependency/join_association.rbの修正です。

ユーザが指定した文字列でのjoin処理ではqueryのretryは行わないよう修正しています。


Update guides: Replace filter with action callback

rails guideのAction Controller Overviewの修正です。

actionのcallback処理について説明している箇所で、古い"filter"という言い方をしている箇所があったのを、"action callback"に修正しています。

rails commit log流し読み(2024/04/22)

2024/04/22分のコミットです。

CHANGELOGへの追加はありませんでした。


Fix ActiveSupport configurations deprecations

activesupport/lib/active_support/railtie.rbの修正です。

Active Supportでdeprecatedになったconfig名のチェック処理が正しく行えてなかったのを修正しています。


Merge pull request #51620 from joshuay03/encourage-lease-connection-on-model-inspect-no-connection

activerecord/lib/active_record/core.rbの修正です。

ActiveRecord::Core#inspectメソッドで、DBに接続していない場合に表示する接続用のメソッド名をconnectionからlease_connectionに変更しています。ActiveRecord::Base.connectionはsoft deprecatedになっている為。


SerializedAttributeTest: use decorate_attribute

activerecord/test/cases/serialized_attribute_test.rbの修正です。

decorated typeに関するテストで、テスト対象のメソッドが誤っていたのを修正しています。


Update comments for helper method generation

actionpack/lib/abstract_controller/helpers.rbactionview/lib/action_view/test_case.rbの修正です。

helper methodを生成するmethod内のコメントが、実際に生成されるmethodと異なる内容になっていたのを修正しています。


Update builder doc links to point to the rails repo [ci skip]

docの修正です。

https://github.com/jimweirich/builderへのリンクをhttps://github.com/rails/builderに修正しています。現在はrails配下のforkしたリポジトリが使用されている為。


Remove reference to BlankSlate

activesupport/lib/active_support/proxy_object.rbのdocの修正です。

現在は存在しないbuilder gemのBlankSlate classについて言及している箇所があったのを修正しています。

rails commit log流し読み(2024/04/20)

2024/04/20分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

actionpack/CHANGELOG.md


[Fix #51095] Missing template error page showing incorrect view path example for nested controller path

actionpack/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erbの修正です。

templateが見つからない場合に表示するエラー用のHTMLで、controller pathがnestしている場合に正しいtemplate名が表示されないバグがあったのを修正しています。


Refactor code to make it more clear

activerecord/lib/arel/visitors/to_sql.rbの修正です。

SQLを生成する際に括弧が必要になる条件のチェックをメソッドに切り出すようリファクタリングしています。


Merge pull request #50856 from Dmoment/docs-autosave-validations

activerecord/lib/active_record/associations.rbのdocの修正です。

has_oneメソッドのdocに、autosave`をtrueにしている場合のvalidationの挙動についての説明を追加しています。


Copy edit documentation

activerecord/lib/active_record/associations.rbのdocの修正です。

has_one`メソッドのdocのフォーマットの修正を行っています。


docs: Fix ActiveSupport::TimeWithZone#change example [skip ci]

activesupport/lib/active_support/time_with_zone.rbのdocの修正です。

ActiveSupport::TimeWithZone#changeメソッドのdoc内のexampleコードの実行結果が、実際の結果と異なっていたのを修正しています。