2015/09/09分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Merge pull request #21512 from X0nic/guides-clarify-timeout-error
rails guideのConfiguring Rails Applications
の修正です。
ActiveRecord::ConnectionTimeoutError
クラスについての説明から、不要なmax poolについての説明を削除しています。
Fixed Time conversion example for UTC time zone [ci skip]
activesupport/lib/active_support/core_ext/string/conversions.rb
のdocの修正です。
to_time
メソッドのexampleに記載している実行結果で、実際の結果と違う箇所があったのを修正しています。
Merge pull request #21502 from bernerdschaefer/bs-polymorphic-url_for-dups-arguments
actionpack/lib/action_dispatch/routing/url_for.rb
、
actionview/lib/action_view/routing_url_for.rb
の修正です。
url_for
メソッドの引数にArrayを指定した場合、引数のArrayを破壊してしまっていたのを、
引数をdupしてから処理を行い引数が変化しないよう修正しています。
下記のように、オプションを使いまわして処理を行う場合に問題があった為、対応したとの事です。
url_options = [:new, :post, param: 'value'] if current_page?(url_options) css_class = "active" end link_to "New Post", url_options, class: css_class
Gemfile
の修正です。
mysql2について、リリース済みのgemを使用するよう修正しています。
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
全てのchained cookie jarクラスの親クラスとなるAbstractCookieJar
クラスを追加しています。
Add commit method to share option normalization
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
先に追加したAbstractCookieJar
クラスにoptionの設定/取得処理を行うようのメソッドを追加しています。元々PermanentCookieJar
クラスで実装されていたメソッドを移動しています。
Use commit in the SignedCookieJar
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
SignedCookieJar
クラスの親クラスにAbstractCookieJar
を指定して、SignedCookieJar
クラスから不要になったoptionの設定処理を削除しています。
Add commit in the EncryptedCookieJar
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
EncryptedCookieJar
クラスの親クラスにAbstractCookieJar
を指定して、EncryptedCookieJar
クラスから不要になったoptionの設定処理を削除しています。
Add parse method to share deserialization logic.
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
各cookie jarクラスそれぞれで行っていたdeserialize処理をメソッド(parse
)に切り出しています。
Call super to remove the verify method
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
UpgradeLegacySignedCookieJar#parse
メソッド内でdeserialize
メソッドを直接呼び出していたのですが、同じ処理を親クラスの同じメソッド(SignedCookieJar#parse
)で行っている為、
ここではdeserialize
メソッドを直接呼び出さず、super
で親クラスのメソッドを呼び出すよう修正しています。
Call super to remove the decrypt_and_verify method
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
UpgradeLegacyEncryptedCookieJar#parse
メソッド内でdeserialize
メソッドを直接呼び出していたのですが、同じ処理を親クラスの同じメソッド(EncryptedCookieJar#parse
)で行っている為、
ここではdeserialize
メソッドを直接呼び出さず、super
で親クラスのメソッドを呼び出すよう修正しています。
Pull up parse to the legacy upgrading module
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
UpgradeLegacySignedCookieJar#parse
、UpgradeLegacyEncryptedCookieJar#parse
メソッドが同じ内容だったので、VerifyAndUpgradeLegacySignedMessage
moduleにメソッドを切り出しています。
Move the request method in to the AbstractCookieJar
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
ChainedCookieJars
moduleで定義されていたrequest
メソッドをAbstractCookieJar
クラスに移動しています。
Push key_generator into SerializedCookieJars
actionpack/lib/action_dispatch/middleware/cookies.rb
の修正です。
ChainedCookieJars
moduleに定義されていたkey_generator
メソッドを SerializedCookieJars
に移動しています。
実際使用しているのが、SerializedCookieJars
をincludeしているクラスだけの為のようです。
Fix typo in activemodel changelog
activemodel/CHANGELOG.md
の修正です。
valid?
/ invalid?
メソッドに複数のコンテキストを渡せるよう対応したコミットのCHANGELOGに記載されているexampleの実行結果が、
実際の結果と異なっていたのを修正しています。
Properly log nested parameters to Active Job
activejob/lib/active_job/logging.rb
の修正です。
Active Jobのperform
メソッドにネストしたパラメータを指定した場合に、ログに正しくパラメータの情報が出力されてなかたったのを、正しく出力されるよう修正しています。
use accessors instead of manipulating the hash
actionpack/lib/action_controller/metal/live.rb
の修正です。
headerの値を取得/設定する際、header hashを直接操作するのではなく、ラッパーメソッド経由で処理行うよう修正しています。
avoid useless string allocations
actionpack/lib/abstract_controller/rendering.rb
、
actionpack/lib/action_controller/metal/rendering.rb
の修正です。
AbstractController::Rendering
moduleの_get_content_type
メソッドで行っていたrendered_format
のStringオブジェクトへの変換処理を削除しています。
render
メソッドで_set_content_type
を呼び出す際に合わせて_get_content_type
メソッドも呼び出すのですが、_set_content_type
を呼び出すのはrequest objectがあるときだけで、request objectがあるときは_get_content_type
の値は無視されてしまうので、結果、変換をしたものの使わない、という状態になってしまっていたので、そもそも変換処理を行わないようにしたとの事です。
push content_type assigment in to metal
Action Packの修正です。
content typeの取得/設定処理をmetal配下で行うよう修正しています。
ensure that content type defaults to text / html when setting charset
actionpack/test/dispatch/response_test.rb
の修正です。
chartsetを設定していた場合、content typeのデフォルトがtext/html
である事を確認するテストを追加しています。
pull content type parsing in to a method
actionpack/lib/action_dispatch/http/response.rb
の修正です。
Response
クラスのコンストラクタで行っていたcontent typeのパース処理を、メソッドに切り出しています。
make Content-Type header the canonical location for content-type info
actionpack/lib/action_dispatch/http/response.rb
の修正です。
Response
クラスのインスタンス変数として保持していたcontent typeに関する情報を、ヘッダーの適切な箇所で保持するよう修正しています。
actionpack/lib/action_dispatch/http/response.rb
の修正です。
content typeのパース処理をprivateメソッドに移動、及び、重複していた処理を削除しています。
remove mime type lookups when parsing the content type
actionpack/lib/action_dispatch/http/response.rb
の修正です。
content typeのパース処理から、mime typeのルックアップ処理を削除しています。
元々は、Mime::Type
クラスのオブジェクトで値を保持しており、オブジェクトを生成する為にルックアップ処理を行っていたのですが、オブジェクトとして値を保持してする必要がないため、ルックアップ処理を削除したようです。
handle implicit rendering correctly
actionpack/lib/action_dispatch/http/response.rb
の修正です。
content typeの挙動の整理をしています。
例えば、chartsetのみを設定していた場合、content headerには; charset=blah
のように空の値が設定されてしまいます。このヘッダーで、再度content typeのパース処理を行った場合に、content typeに適切にnilが設定されるよう修正しています。
avoid allocations when there is no content type set
actionpack/lib/action_dispatch/http/response.rb
の修正です。
content typeが設定されていなかった場合、毎回ContentTypeHeader.new(nil, nil)
を生成していたのを、クラス内で値を定義し、クラスロード時に一度だけインスタンス生成処理がおこなわれるよう修正しています。
remove parse_content_type
parameter
actionpack/lib/action_dispatch/http/response.rb
の修正です。
parse_content_type
メソッドから、使用していない変数を削除しています。
mime_type will always return a string
actionpack/lib/action_dispatch/http/response.rb
の修正です。
content_type
メソッドから、不要なmime typeのStringへの変換処理を削除しています。
ensure that mutating headers will impact the content_type method
actionpack/test/dispatch/response_test.rb
の修正です。
reponsen headerに直接Content-Type
を設定した場合に、Response#content_type
メソッドが正しい値を返す事を確認するテストを追加しています。
Fix docs of AR::Timestamp to match #15726
activerecord/lib/active_record/timestamp.rb
のdocの修正です。
Time columns should support time zone aware attributes の対応により、time型のカラムもTimeZoneの影響を受けるようになったので、その旨Time Zoneのdocを修正しています。
Rails documentation use american english.[ci skip]
activesupport/lib/active_support/core_ext/file/atomic.rb
のdocの修正です。
File.atomic_write
メソッドのdoc内にあったbehaviour
をbehavior
に修正しています。
behaviour
は英国英語なのですが、Railsは米国英語を使うよう統一しているので、修正しています。
Added nodoc for arel
method which returns object of private api. [ci skip]
activerecord/lib/active_record/associations/collection_proxy.rb
の修正です。
内部APIのCollectionProxy#arel
メソッドに:nodoc:
を設定しています。
Merge pull request #20921 from pboling/fix-sql-colors-in-log-subscriber
activerecord/lib/active_record/log_subscriber.rb
の修正です。
More granular console SQL colorationで、 sql query毎に色分け(insert
は緑、select
は青とう)して出力されるようになったのですが、
queryがネストしていた場合に正しく色分け出来ていなかったのを対応、及び、rollbackやtransactionにも色をつけて表示するよう修正しています。……大分カラフルな感じに…。
Merge pull request #20080 from robertjlooby/fix_overwriting_by_dynamic_finders
activerecord/lib/active_record/dynamic_matchers.rb
の修正です。
modelで独自のfinderメソッド(find_by_xxx
)を定義した場合に、そちらのメソッドが使用されるよう対応しています。
例。
class Device def self.find_by_mac_address(address) super(MacAddress.new(address).normalized) end end
一度はマージされたものの、同じメソッドが複数回定義されてしまうバグがあった為、直ぐrevertされています。
Revert "Merge pull request #20080 from robertjlooby/fix_overwriting_by_dynamic_finders"
という訳で先のfinderメソッドについてのコミットをrevertしています。
activerecord/lib/active_record/tasks/database_tasks.rb
の修正です。
使用されていないload_schema_current_if_exists
メソッドを削除しています。
activerecord/lib/active_record/schema.rb
の修正です。
Schema#define
メソッド内のversion
チェック処理を、unless
+ blank?
を使用していたのを、if
+ present?
を使用するよう修正しています。
- unless info[:version].blank? + if info[:version].present?
Don't set the default argument
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
の修正です。
assume_migrated_upto_version
メソッドの第二引数のmigrations_paths
からデフォルト引数を削除しています。値は必ず渡される為との事です。
adjust method visibility according to it's usage.
activerecord/lib/active_record/schema.rb
の修正です。
public APIではないSchema#migrations_paths
の可視性をpublicからprivateに変更、及びnodoc
を設定しています。
activerecord/lib/active_record/migration.rb
の修正です。
使用されていないmigrations_path
メソッドを削除しています。
Merge pull request #21529 from rngtng/move-migrations-paths-to-database-task
activerecord/lib/active_record/railties/databases.rake
の修正です。
db rake配下の各多数で、Migrator.migrations_paths
の代わりにActiveRecord::Tasks::DatabaseTasks.migrations_paths
に設定された値を使用するよう修正しています。
Allow global migrations_path configuration with using value from database_tasks instead of Migrator のフォローアップ対応です。
Merge pull request #21486 from bogdan/refactor-has-many-counter-cache
Active Recordの修正です。
HasManyAssociation
クラスで定義していたcounter cacheに関する処理の一部を、Reflection
モジュール配下に移動しています。
belons_to associationに関しては、元々Reflection
モジュールでcounter cacheの処理を定義しており、処理を統一する為に移動したようです。
Handle Content-Types that are not :json, :xml, or :url_encoded_form
actionpack/lib/action_controller/test_case.rb
の修正です。
TestRequest#assign_parameters
メソッドで、Content-typeが:json
, :xml
, または :url_encoded_form
以外の場合に、request.request_parametersに値が設定されない問題があったのを修正しています。
合わせて、不正なcontent typeを指定した場合に、RuntimeErrorをraiseするよう修正しています。
Update documentation to reflect Rack::Session::Abstract changes
actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
のdocの修正です。
CookieStore
クラスの親クラスがRack::Session::Abstract::ID
からRack::Session::Abstract::Persisted
に変わったのですが、ドキュメントが古いままだったので、親クラスの説明をRack::Session::Abstract::Persisted
に修正しています。
activerecord/lib/active_record/migration.rb
の修正です。
使用していないlast_version
メソッドを削除しています。