なるようになるブログ

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

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

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

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

activemodel/CHANGELOG.md


Fix error messages scope [skip ci]

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

ActiveModel::Errors#generate_messageの説明中の、i18n scopeの説明に誤りがあったのを修正しています。

-    # Error messages are first looked up in <tt>models.MODEL.attributes.ATTRIBUTE.MESSAGE</tt>,
-    # if it's not there, it's looked up in <tt>models.MODEL.MESSAGE</tt> and if
+    # Error messages are first looked up in <tt>activemodel.errors.models.MODEL.attributes.ATTRIBUTE.MESSAGE</tt>,
+    # if it's not there, it's looked up in <tt>activemodel.errors.models.MODEL.MESSAGE</tt> and if

"models.MODEL" -> "activemodel.errors.models.MODEL" ですね。


Relax Rack dependency

actionpack/actionpack.gemspecの修正です。

rackのバージョンを"1.6.0" -> "1.6"に修正しています。


Removing :en in favor of I18n.default_locale in duration#inspect

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

Duration#inspectでエラーメッセージを出力するときのlocaleを:enからI18n.default_localeに修正しています。

-        to_sentence(:locale => :en)
+        to_sentence(locale: ::I18n.default_locale)

enのlocaleを使用してない場合にエラーになってしまう為、default_localeに修正したとの事です。


Merge pull request #18439 from mokhan/validates-acceptance-of-array

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

validates_acceptance_ofのデフォルトを"1"から、"1"とtrueに修正しています。

Topic.validates_acceptance_of(:terms_of_service)
Topic.new(terms_of_service: true).valid? # => true

Change a to an for HTML word [ci skip]

rails guideのLayouts and Rendering in Railsの修正です。

"a HTML" -> "an HTML"に修正しています。


Digesting is now enabled by default in development

rails guideのThe Asset Pipelineの修正です。

Rails 4.0から、development環境でもassetsにdigestが付与されるようになったのですが、説明が古いままだったのを修正しています。