2016/04/05分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activemodel/CHANGELOG.md
Merge pull request #24332 from blackchestnut/doc/deprecation_warn
railties/lib/rails/application/configuration.rb
の修正です。
serve_static_files
を使用した場合に出るエラーメッセージのpublic_file_server.enabled
について説明している箇所にconfig
を追加しています。
ActiveSupport::Deprecation.warn <<-eow.strip_heredoc `serve_static_files` is deprecated and will be removed in Rails 5.1. - Please use `public_file_server.enabled` instead. + Please use `config.public_file_server.enabled` instead. eow
rails guideのActive Record Validations
の修正です。
errors.clear
の項のexampleで、使用している変数名をタイポしている箇所があったのを修正しています。
Use QUOTED_TRUE
and QUOTED_FALSE
instead of magic strings
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
の修正です。
MysqlString#serialize
メソッドで、true
/ falseの変換時にマジックナンバー("1" / "0")を使用していたのを、定義済みの定数(
QUOTED_TRUE/
QUOTED_FALSE`)を使用するよう修正しています。
actionpack/CHANGELOG.md
、
guides/source/5_0_release_notes.md
の修正です。
it's
-> its
に修正しています。
Merge pull request #24401 from pan/number-to-phone
Action View / Active Supportの修正です。
number_to_phone
メソッドにformatを指定する為のpattern
オプションを使用出来るよう修正しています。
number_to_phone(75561234567, pattern: /(\d{1,4})(\d{4})(\d{4})$/, area_code: true) # => "(755) 6123-4567" number_to_phone(13312345678, pattern: /(\d{3})(\d{4})(\d{4})$/) # => "133-1234-5678"
デフォルトはUS formatのままです。
Merge pull request #24345 from mtsmfm/fix-marshal-with-autoloading-for-nested-class
activesupport/lib/active_support/core_ext/marshal.rb
の修正です。
Marshal.load
メソッドで、ネストしたclass / moduleのautoload処理が正しく行えないバグがあったのを修正しています。
Guides changes, follow up of #24401
rails guideのAction View Overview
の修正です。
number_to_phone
メソッドについて説明している箇所に、デフォルトはUS formatである旨説明を追加しています。
Allow passing record being validated to error message generator
activemodel/lib/active_model/errors.rb
の修正です。
ActiveModel::Errors::generate_message
メソッドでエラーメッセージを組み立てる際に、I18n.translate
メソッドにobject
を渡すよう修正しています。
これにより、カスタムエラーメッセージで、オブジェクトの情報が使用出来るようになっています。
Topic.validates_presence_of(:title, message: proc { |record| "You have failed me for the last time, #{record.author_name}." }) t = Topic.new(author_name: 'Admiral') t.invalid? t.errors[:title] #=> "You have failed me for the last time, Admiral."
Update documentation based on the new changes for strong & weak ETags [ci skip]
rails guideのCaching with Rails: An Overview
の修正です。
ETagについて説明している箇所に、strong ETagについての説明を追加、weak ETagとstrong ETagについての違いについての説明を追加、等を行なっています。
Action Cableの修正です。
WebSocketで通信をする際に、protocolを使用するよう修正しています。
Sec-WebSocket-Protocol
というヘッダがあるんですねえ。参考:RFC 6455 - The WebSocket Protocol (日本語訳)