2015/05/29分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Remove already defined methods in super class of ActionDispatch::Request class
actionpack/lib/action_dispatch/http/request.rb
の修正です。
不要な、Request#get?
、Request#post?
、Request#patch?
、Request#put?
、Request#delete?
、Request#head?
メソッドを削除しています。同じメソッドが親クラスであるRack::Request
に定義済みの為、との事です。
removed erroneous line. Corrected presence validation example.
rails guideのActive Record Validations
の修正です。
boolean型のattributeにvalidates presence: true
を使用する、という誤った例が記載されていたのを削除しています。
Merge pull request #20331 from arunagw/arunagw-remove-unused-package-tasks
各コンポーネントのRakefile
の修正です。
使用していないpackage 用のタスクを削除しています。今はリリースにはall:build
タスクというのを使用しているとの事です。
Merge pull request #20017 from eliotsykes/configurable-static-index-filename
ActionDispatch::Static
、ActionDispatch::Static
クラスのコンストラクタにインデックス ファイル名を指定出来るよう対応しています。また、コンストラクタに指定するファイル名はconfig.static_index
に指定された値が設定されます。 デフォルトは変わらず"index"(index.html)です。
Allow proc defaults with the Attributes API
ActiveRecordの修正です。
Attributes APIのdefault
オプションに、Procを指定出来るよう対応しています。
例。
class OverloadedType < ActiveRecord::Base @@counter = 0 attribute :counter, :integer, default: -> { @@counter += 1 } end
Persist user provided default values, even if unchanged
activerecord/lib/active_record/attribute/user_provided_default.rb
、
activerecord/lib/active_record/attributes.rb
の修正です。
Attributes APIのdefault
オプションに指定した値を、DBに保持するよう修正しています。
例。
class Account < ActiveRecord::Base attribute :name, :string, default: "my default" end Account.create! puts Account.last.name.inspect # => “my default”
ちょっとだけ、違和感が…。
Remove use of mocha from Active Model
ActiveModelの修正です。
テストのmock処理にmocha
を使用するのを止めています。
Fix the shadowing warning for reflection
activerecord/lib/active_record/relation/merger.rb
の修正です。
merge_preloads
メソッドで"shadowing warning for reflection
" のwarningが出ていたのを、変数名を変更して対応しています。
activesupport/lib/active_support/core_ext/enumerable.rb
の修正です。
配列から同じキーの値を取得するEnumerable#pluck
メソッドを追加しています。
[{ name: "David" }, { name: "Rafael" }, { name: "Aaron" }].pluck(:name) => ["David", "Rafael", "Aaron"]
Merge pull request #20267 from kaspth/fix-minitest-constant-clashing
ActiveSupportのテストの修正です。
テスト用にE
という名前のクラスを定義していたのですが、Minitestで同名の定数を定義している為、名前がかぶらないよう、EM
という名前にクラス名を変更しています。
Updating the guides for Enumerable#pluck
rails guideのActive Support Core Extensions
の修正です。
先に追加されたEnumerable#pluck
メソッドについての説明を追加しています。
Use bundler < 1.10 until its bugs are fixed
.travis.yml
の修正です。
テストで使用するbundler
のバージョンを1.10
以下に固定しています。 どうもRubyGemsのバージョンチェック処理にバグがあるらしく、そちらのバグが直るまで、古いバージョンを使用するようにするためのようです。bundleのissueはこちら。
.travis.yml
の修正です。
先のコミットの続きです。before_install
で、gem install bundler
する前にgem uninstall bundler
して、キャッシュされてるbundler
を削除するよう修正しています。
.travis.yml
の修正です。
先のコミットの続きです。gem uninstall bundler
する際、-x --force
オプションを付与して、強制的に削除するようにしています。
Merge pull request #19878 from pabloh/replace_alias_chains_with_prepend
ActiveSupportの修正です。
Date
クラス、Time
クラスで既存のメソッドの書き換えを行うのにalias_method
を使って行っていたのを、Module#prepend
を使用しるよう修正しています。
先に記載したRubyGemsのバージョンチェック処理のバグを修正したbundler 1.10.1をリリースしたので、bundler 1.10がインストールされないようにしたコミットをrevertしています。
まずは、Force the uninstall のコミットをrevertしています。
Revert "Uninstall bundler 1.10"
先のコミットの続きです。Uninstall bundler 1.10 をrevertしています。
Fix warning about ambiguous first argument
actionpack/test/controller/log_subscriber_test.rb
の修正です。
ambiguous first argument
のwarnigが出ていたのを、メソッドの引数に()
を追加して対応しています。
- assert_match /Completed 200 OK in [\d]ms/, logs[1] + assert_match(/Completed 200 OK in [\d]ms/, logs[1])
Revert "Use bundler < 1.10 until its bugs are fixed"
bundlerの対応の続きです。
Use bundler < 1.10 until its bugs are fixed をrevertしています。
Generate Bundler 1.10.1 lockfile
Gemfile.lock
の修正です。
lockfile で 1.10.1を使用するようバージョン定義を追加しています。
+ +BUNDLED WITH + 1.10.1
こんな書き方出来るんですねえ。
actionpack/lib/action_controller/test_case.rb
の修正です。
使用していない@assigns
変数への値のセット処理を削除しています。
Update docs for ActiveRecord serialize
activerecord/lib/active_record/attribute_methods/serialization.rb
のdocの修正です。
PostgreSQLのjson/jsonb型を使用する場合serialize
を使用する必要は無いというのと、データが複雑な場合、ActiveRecord::Attributes APIを使用する事を検討した方が良い旨ノートを追加しています。