2014/06/14分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- ActionController::Parameters#require now accepts FalseClass values
- Fix request's path_info when a rack app mounted at '/'.
- Detect in-place changes on mutable AR attributes
- Through associations should set both parent ids on join models
- Parsing DATABASE_URI, use URI#hostname: it's smarter about IPv6
- Deprecate
serialized_attributes
without replacement
activemodel/CHANGELOG.md
Introduce an Attribute object to handle the type casting dance
ActiveRecordの修正です。
ActiveRecord::Attribute
クラスを新規に作成して、type castに関する処理を移動しています。まだまだ対応中の模様。
Ensure we always define attribute methods
activerecord/lib/active_record/core.rb
の修正です。
initialize
にself.class.define_attribute_methods
を追加して、必ずattribute methodsが定義されるようにしています。
Specifically talking about Rake the library [ci skip]
activerecord/lib/active_record/tasks/database_tasks.rb
のdocの酒精です。
接続詞を修正しています。
Add links to RDoc back into API documentation guidelines [ci skip]
rails guideのAPI Documentation Guidelines
の修正です。
RDocについてのリンクを追加しています。元々あったものが、間違いで消されてしまったようで、復旧しています。
Builder source code is still available on github [ci skip]
actionview/lib/action_view/base.rb
のdocの修正です。
builderへのリンクを追加しています。
[ci skip] Clarify ActiveModel::Model docs
activemodel/lib/active_model/model.rb
のdocの修正です。
ActiveModelのattributesの実行結果の例がIntegerになっていたのですが、戻り値はStringなので、実行結果をStringに修正しています。
- # person.name # => 'bob' - # person.age # => 18 + # person.name # => "bob" + # person.age # => "18"
Document behavior concerns regarding the full Rails stack [ci skip]
rails guideのAPI Documentation Guidelines
の修正です。
Regarding the Rails Stack
の項を追加しています。
class 又はメソッドのdocを作成する際、scope / contextを意識して下さい、という事かと。
例として、ActionView::Helpers::AssetTagHelper#image_tag
メソッドが挙げられています。
ActionController::Parameters#require now accepts FalseClass values
ActionController::Parameters#require
メソッドがFalseClassの値も受け取る修正しています。
# before ActionController::Parameters.new({discount:false}).require(:discount) # ActionController::ParameterMissing: param is missing or the value is empty: discount # after ActionController::Parameters.new({discount:false}).require(:discount) # false
元々、文字列のfalse
は受け付けていたんですねえ。
Copy edits and code font wrap for Active Record [ci skip]
activerecord/lib/active_record/errors.rb
のdocの修正です。
元々は<tt>
でコードで等幅フォントを行っていたのを、+
記号に修正しています。RDoc的には+
でOKですね。
Copy edits from e0f3f1a [ci skip]
rails guideのAPI Documentation Guidelines
の修正です。
先ほど作成したRegarding the Rails Stack
の項について、指摘を受けて箇所について微修正を行っています。
Create 4.2 release notes guide scaffold [ci skip]
guides/source/4_2_release_notes.md
の叩きの作成です。 Major Features
の記載はまだのもよう。
First pass at Rails 4.2 release notes [ci skip]
guides/source/4_2_release_notes.md
の修正です。
Remove
をDeprecate
に修正しています。
Remove unused column types override
activerecord/lib/active_record/core.rb
の修正です。
使用していない@column_types_override
を削除しています。
Revert code changes at "Copy edits and code font wrap for Active Record [ci skip]"
先にあったactiverecord/lib/active_record/errors.rb
のdocの修正で、全然関係無い実装処理をいじってしまったらしく、その部分だけrevertしています。
Reorder test which does not represent real world usage
activerecord/test/cases/attribute_methods_test.rb
の修正です。
クラス定義した後にインスタンス生成するよう、処理の順番を修正しています。
real world usage
は、まあ、確かにそうですよね。
ActionViewの修正です。
render
、mail_to
メソッドからhtml_safe処理を削除しています。
コミットログに記載された理由は下記の通りです。
- Your code should have access to the actual string value of any parameter, not the encoded version.
- You should not care about the exact encoding as HTML.
- Thinking about how to safely encode strings is hard, and tag already does a fine job.
1はまあその通りかなーとは思うのですが…。むう。最終的に、3の理由が大きいんですかねえ。
Reword PreparedStatementInvalid example, and use values instead of
activerecord/lib/active_record/errors.rb
のdocの修正です。
説明をちょっと修正しています。
s/variable supplied/value supplied [ci skip]
activerecord/lib/active_record/errors.rb
のdocの修正です。
コミットログの通りで、variable supplied
をvalue supplied
に置換しています。
Remove unused method_missing
definition
activerecord/lib/active_record/attribute_methods.rb
の修正です。
使用していないmethod_missing
メソッドを削除しています。
method_missing
が起きる事は無いから、との事です。
Detect in-place changes on mutable AR attributes
ActiveRecordの修正です。
mutable types(Serialized, JSON, HStore)を使用しているとき、attributesが変更された際に正しく検知が出来ていなかったのを修正しています。
ActiveModel::Dirty
で値が変更があったかどうか検知出来るのですが、先にあげた型については、正しく検知が出来ていなかったもよう。知らなかった。
Through associations should set both parent ids on join models
ActiveRecordの修正です。
save
を行う際、親クラスのidもセットされるよう対応しています。
コミットログの例から抜粋。
member = Member.new(club: Club.new) member.save! # Before: member.current_membership.club_id # => nil # After: member.current_membership.club_id # => club's id
Fix request's path_info when a rack app mounted at '/'.
actionpack/lib/action_dispatch/journey/router.rb
の修正です。
rack appを'/'にマウントした時に、`env['PATH_INFO']からスラッシュが消えてしまっていたのを修正しています。
Open extension point for defining options in build_through_record
activerecord/lib/active_record/associations/has_many_through_association.rb
の修正です。
以下のようなケースでエラーになってしまったのを修正しています。
class Group < ActiveRecord::Base ... has_many :members, :through => :memberships, :source => :user end group.members << user
リグレッション対応。
Remove serialized?
from the type interface
ActiveRecordのtype classの修正です。
serialized?
メソッドを削除しています。
Parsing DATABASE_URI, use URI#hostname: it's smarter about IPv6
activerecord/lib/active_record/connection_adapters/connection_specification.rb
の修正です。
DATABASE_URIにURI#hostname
を使用するよう修正しています。IPv6対応。
SecurePassword - Validate password must be less than or equal to 72
activemodel/lib/active_model/secure_password.rb
の修正です。
パスワードの最大長を設定しています。値は72です。BCryptで生成される値の最大長が72だからとの事です。
Added changelog for #15708 [ci skip]
先ほどのパスワード最大長の修正について、CHANGELOGに追記しています。
Cleaned up the has_secure_password
test cases
activemodel/test/cases/secure_password_test.rb
の修正です。
テスト処理をまとめたり、不要なテストケースを削除したり対応しています。
Make sure restoration always happen.
actionview/test/template/digestor_test.rb
の修正です。
ActionView::Resolver.caching
の値を元に戻す処理を、ensure
ブロックで実行するよう修正しています。必ず実行されるようにですね。
Avoid hard-coded value in test setup and teardown.
actionview/test/template/javascript_helper_test.rb
の修正です。
値がハードコードされていたのを、メソッドから値を取得するよう修正しています。
Use @existing_user
while updating existing user, fixing - #ee4e86
activemodel/test/cases/secure_password_test.rb
の修正です
@user
を使用している箇所を、@existing_user
を使用するよう修正しています。
@user
はインスタンス生成しているだけで、実際DBにデータがあるインスタンスでは無いようです。
pg guide, use the term database views
to be specific. [ci skip]
rails guideのActive Record and PostgreSQL
の修正です
views
をdatabase views
に修正しています。
Deprecate serialized_attributes
without replacement
activerecord/lib/active_record/attribute_methods/serialization.rb
の修正です。
serialized_attributes
がdeprecateになりました。代わりにtype objectを使用するゆうに、との事です。
[ci skip] Update #has_secure_password docs
activemodel/lib/active_model/secure_password.rb
のdocの修正です。
has_secure_password
メソッドのdocを修正しています。パスワード最大長が72文字である旨説明を追加しています。
docs, remove getting started guide sample application. [ci skip]
rails guideのgetting started guide
にあったサンプルアプリを削除しています。
メンテがされてない、かつ、そもそもguideの中で説明しているので、不要なのでは、との事です。