なるようになるブログ

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

rails commit log流し読み(2021/01/19)

2021/01/19分のコミットです。

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


Fix grammar and typos

rails guideのWebpackerの修正です。

各項の、グラマー、タイポの修正を行っています。


Fixed multiple enums declaration with prefix/suffix

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

複数のenum定義 + _prefix / _suffixオプションを指定した場合にArgumentErrorになってしまうバグがあったのを修正しています。


Merge pull request #41139 from kamipo/fix_decorated_type_with_serialized_attribute

Active Recordの修正です。

Unify decorate_attribute_type and attributeの対応により、store attributeを新しいtypeで再定義、するという事が出来なくなってしまっていたのを、出来るよう修正しています。

rails commit log流し読み(2021/01/18)

2021/01/18分のコミットです。

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


Make ActiveModel's attribute behavior follow ActiveRecord's

activemodel/lib/active_model/attributes.rbの修正です。

Active Modelのattributeメソッドの挙動を、Active Recordのattributeのメソッドと一致するよう修正しています。


Fix joins that reserved word association is referenced in where

activerecord/lib/active_record/associations/join_dependency.rbの趣味です。

予約語と同じ名前のassociationをjoinに指定 + そのassociationをwhereで参照した場合に、エラーになってしまうバグがあったのを修正しています。


Merge pull request #41067 from eugeneius/relative_file_fixture_path

actionpack/lib/action_dispatch/testing/test_process.rbの修正です。

fixture_file_uploadでpathがfixture_path相対パスかをチェックする際に、file_fixture_path相対パスfixture_path絶対パスの場合に正しくチェックが行わないバグがあったのを修正しています。


Add a Webpacker guide [ci skip] (#40817)

Webpackerについて説明しているWebpacker guideを追加しています。


Explicit check for html and text parts

railties/lib/rails/templates/rails/mailers/email.html.erbの修正です。

メールのpreviewで、添付ファイルがある場合はHTML / text partが1つか無い場合も、format selectorが表示されるよう修正しています。

rails commit log流し読み(2021/01/17)

2021/01/17分のコミットです。

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


Fix ActiveRecord::ConnectionAdapters::QueryCache#dirties_query_cache

activerecord/lib/active_record/connection_adapters/abstract/query_cache.rbの修正です。

create実行後にquery cacheのcleanupが行われていなかったのを、cleanupが行われるよう修正しています。

rails commit log流し読み(2021/01/16)

2021/01/16分のコミットです。

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


Merge pull request #41122 from pdcribeiro/fix-getting-started-guide

rails guideのGetting Started with Railsの修正です。

Using Concernsの項にあるexampleコードでパラメータ名をタイポしている箇所があったのを修正しています。


Just use regexp literal for assert_match

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

assert_matchRegexpを指定する際に、regexp literalを使用するよう修正しています。

rails commit log流し読み(2021/01/14)

2021/01/14分のコミットです。

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


Improve strict_loading violation error message

Active Recordの修正です。

strict_loadingに違反した場合のエラーメッセージに、association nameを含むよう修正しています。


Update platforms in Gemfile.lock

Gemfile.lockの修正です。

Gemfile.lockplatformsの定義を更新しています。


Change Numericaly validator to use round

activemodel/lib/active_model/validations/numericality.rbの修正です。

Numericaly validatorでscaleを扱うのにtruncateを使用していたのを、roundを使用するよう修正しています。

Active Recordのdecimal typeの変換処理と挙動を合わせる為。


Fix test failing on ruby master

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

BigDecimal 3.0.1で、FloatからDecimalに変換する際の挙動が変わった影響でコケているテストがあったのを修正しています。

参考: Allow digits=0 in BigDecimal(flt) and Float#to_d


Exercise tests on decimal attribute values

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

decimal attributeにString、BigDecimalの値を指定した場合のテストを追加しています。

rails commit log流し読み(2021/01/13)

2021/01/13分のコミットです。

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


Define Singleton#duplicable? and return false

activesupport/lib/active_support/core_ext/object/duplicable.rbの修正です。

Singleton#duplicable?メソッドを追加しています。

Mime::NullTypeのようなsingletonなクラスに対してdeep_dupを行った場合に、duplicable?が定義されてないとエラーになってしまう為。


Fix "NoMethodError: undefined method -@'" forsource_type` with a symbol

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

associationのsource_typeにSymbolを指定した場合にNoMethodErrorが発生してしまうバグがあったのを修正しています。


Fix issue routing with optional parts of a segment

actionpack/lib/action_dispatch/journey/path/pattern.rbの修正です。

routesに"."、 "/"で区切られていないoptional segmentがあった場合に、正しくroutingが行われないバグがあったのを修正しています。