2015/11/24分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Test if each_object(singleton_class) works, since JRuby added it.
activesupport/lib/active_support/core_ext/class/subclasses.rb
の修正です。
Class#descendants
メソッドを定義する際に、ObjectSpace.each_object
メソッドの引数にオブジェクトを指定していたのを、singleton classを指定するよう修正しています。
- ObjectSpace.each_object(Class.new) {} + # Test if this Ruby supports each_object against singleton_class + ObjectSpace.each_object(Numeric.singleton_class) {}
元々JRubyではObjectSpace.each_object
の引数にsingleton classは指定出来なかったのですが、JRuby 9.0.5.0から指定出来るようになった、かつ、singleton classで見れない場合、descendants
メソッドではObjectSpace.each_object
にClass
を指定してチェックするようにしているのですが、Class
経由だと数が多く、性能が悪いため修正したとの事です。
Remove blanket array delegation from Relation
activerecord/lib/active_record/relation/delegation.rb
の修正です。
ActiveRecord::Delegation
から、Relation
からArray
にdelegation出来ないメソッドの一覧を定義していたBLACKLISTED_ARRAY_METHODS
定数を削除しています。
black listで全てのメソッドを対応出来てはいなかった、かつ、現在Relation
はEnumerable
をincludeしており、Arrayにdelegateしなくてはならないメソッドは少なくなった為、black listの方は削除し、Arrayにdelegateするメソッドの定義の方を更新し、対応しています。
Merge pull request #22372 from greysteil/clearer-ip-spoofing-comment
actionpack/lib/action_dispatch/middleware/remote_ip.rb
の修正です。
check_ip_spoofing
-> ip_spoofing_check
に変数名を変更、及びIpSpoofAttackError
が発生する場合の振る舞いについての詳細な説明を追加しています。
Move migration/postgresql_geometric_types_test.rb
in adapters/postgresql/geometric_test.rb
activerecord/test/cases/adapters/postgresql/geometric_test.rb
、
activerecord/test/cases/migration/postgresql_geometric_types_test.rb
の修正です。
PostgreSQLのgeometric型に関するテストを、activerecord/test/cases/adapters/postgresql/geometric_test.rb
からactiverecord/test/cases/migration/postgresql_geometric_types_test.rb
に移動しています。
Add schema dumping support for PostgreSQL geometric data types
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
の修正です。
PostgreSQLのGeometric Types(line
、lseg
、box
、path
、polygon
、circle
)がschema dump時に正しく出力されるよう修正しています。
Merge pull request #18446 from cloud8421/actionmailer-unregister-interceptor
actionmailer/lib/action_mailer/base.rb
、actionmailer/lib/action_mailer/preview.rb
の修正です。
動的にinterceptor、preview_interceptorの解除をする為のBase.unregister_interceptor
, Base.unregister_interceptors
, Base.unregister_preview_interceptor
及び Base.unregister_preview_interceptors
メソッドを追加しています。
Merge pull request #17928 from sergey-alekseev/remove-unused-form-data-method
actionpack/lib/action_dispatch/http/request.rb
の修正です。
ActionDispatch::Request#form_data?
メソッドで、media typeのチェックで、content_mime_type
を直接参照していたのを、ラッパーメソッドである#media_type
メソッドを使用するよう修正しています。
Merge pull request #17013 from gsamokovarov/fix-null-resolver
actionview/lib/action_view/testing/resolvers.rb
の修正です。
ActionView::NullResolver#query
メソッドでActionView::Template
のインスタンスを作成する際、参照する値を謝っていたのを修正しています。
class NullResolver < PathResolver def query(path, exts, formats) handler, format, variant = extract_handler_and_format_and_variant(path, formats) - [ActionView::Template.new("Template generated by Null Resolver", path, handler, :virtual_path => path, :format => format, :variant => variant)] + [ActionView::Template.new("Template generated by Null Resolver", path.virtual, handler, :virtual_path => path.virtual, :format => format, :variant => variant)] end end
Merge pull request #21000 from twalpole/find_or_parameter_issues
Active Record / Active Modelの修正です。
ActionController::Parameters
がHashWithIndifferentAccess
の子クラスで無くなった影響で、forbidden_attributes_protection
のテスト用クラスをHashWithIndifferentAccess
から継承させないよう修正、
及びWhereChain#not
メソッドで引数のsanitizeチェックを行うよう修正しています。
Revert "Merge pull request #18446 from cloud8421/actionmailer-unregister-interceptor"
動的にinterceptor、preview_interceptorの解除をする為のBase.unregister_interceptor
, Base.unregister_interceptors
, Base.unregister_preview_interceptor
及び Base.unregister_preview_interceptors
メソッドを追加した Merge pull request #18446 from cloud8421/actionmailer-unregister-interceptor をrevertしています。
テストでmochaを使うようになっていたのですが、このPRを投げられた後に、テストでmochaを使わないようになっており、その影響でテストがコケてしまった為、一旦revertしたとの事です。
Fix test failures caused by #21000
activemodel/test/cases/attribute_assignment_test.rb
の修正です。
active_support/core_ext/hash/indifferent_access
のrequireが不足していたのを追加しています。
set_field_encoding
is only needed for MysqlAdapter
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
、
activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
、
activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
の修正です。
引数の値をそのまま返すだけだったActiveRecord::ConnectionAdapters::Mysql2Adapter#set_field_encoding
メソッドを削除、及びActiveRecord::ConnectionAdapters::AbstractMysqlAdapte#column
メソッドで直接set_field_encoding
メソッドを呼び出さないよう修正しています。
Fix more test failures caused by #21000
activerecord/test/cases/forbidden_attributes_protection_test.rb
の修正です。
各テスト用modelのrequireが不足していたので追加しています。
Merge pull request #22272 from y-yagi/remove_test_files_in_plugin_gemspec
railties/lib/rails/generators/rails/plugin/templates/%name%.gemspec
の修正です。
rails plugin用のgemspecのテンプレートでtest_files
オプションを使用していたのを、削除しています。
test_files
オプションがdeprecateになっている(Documentation about 'test_files' is confusing · Issue #90 · rubygems/guides)と思われる為、削除されています。
Remove valgrind note about linux only support
rails guideのDebugging Rails Applications
の修正です。
Valgrindについて説明している箇所に、Linuxだけのアプリである旨記載されてあったのですが、Valgrind 3.11.0からMac OSXもサポートするようになった(Valgrind)為、該当部分の記載を削除しています。
Merge pull request #22287 from dharamgollapudi/patch-2
railties/lib/rails/tasks/dev.rake
の修正です。
dev:cache
taskについてのdescを、task -T
でタスク名が表示されるよう、taskの定義の上に移動しています。
Merge pull request #22120 from hnatt/refactor-actionmailer
actionmailer/lib/action_mailer/base.rb
の修正です。
ActionMailer::Base
クラスのリファクタリングを行っています。
register_observer
メソッド、register_interceptor
メソッドでで共通していた処理をメソッドに切り出し、デフォルトの値の設定処理をメソッドに切り出し、変数名を適切な名前に変更、等を行っています。
actionmailer/lib/action_mailer/base.rb
の修正です。
observer_class_for
メソッドに:nodoc:
を設定しています。
Avoid mutating the headers hash
actionmailer/lib/action_mailer/base.rb
の修正です。
mail
メソッド内で、headers
hashから値をdeleteしていたのを、headers
hashの状態は変えないよう修正しています。
Put all private method together
actionmailer/lib/action_mailer/base.rb
の修正です。
private メソッドがクラス内に点在していたのを、位置を一箇所にまとめるよう、メソッドの位置を移動しています。
Move all nodoc methods to the private section
actionmailer/lib/action_mailer/base.rb
の修正です。
rails内部用のメソッドについて、全てprivateセクションに移動しています。
Merge pull request #22172 from tijmenb/fix-source-in-show-exception
Action Packの修正です。
source codeのtemplateに、textのtemplateを追加しています。
AJAXでエラーが起きた際に、htmlではなくtextでrenderされるようにする為に追加されています。
PRより。
# before $curl 'http://localhost:3000/' -H 'X-Requested-With: XMLHttpRequest' RuntimeError in PostsController#index <div class="source " id="frame-source-0"> <div class="info"> Extracted source (around line <strong>#3</strong>): </div> <div class="data"> <table cellpadding="0" cellspacing="0" class="lines"> <tr>
# after $curl 'http://localhost:3000/' -H 'X-Requested-With: XMLHttpRequest' RuntimeError in PostsController#index Extracted source (around line #3): #1 class PostsController < ApplicationController #2 def index *3 raise #4 end #5 end
Merge pull request #22214 from kamipo/not_passing_native_database_types_to_table_definition
Active Recordの修正です。
TableDefinition#new
の引数から、native_database_types
を削除しています。
native_database_types
はlimit
オプションのデフォルトとの値を取得するためだけに使われていたのですが、 type_to_sql
メソッドで同じ処理をしており、TableDefinition
で行う必要は無い為、削除したとの事です。
Merge pull request #22370 from yui-knk/remove_blank_line
railties/lib/rails/generators/rails/plugin/templates/rails/routes.rb
の修正です。
pluginのroutes.rbのtemplateから、不要な空行を削除しています。
Merge pull request #22348 from kv109/22233_without_deprecation
activesupport/lib/active_support/values/time_zone.rb
の修正です。
スイスのtimezoneのマッピングが間違えていたのを修正しています。
- "Bern" => "Europe/Berlin", + "Bern" => "Europe/Zurich", + "Zurich" => "Europe/Zurich",
IANAによると、Zurich => Europe/Zurich があれば良いのですが、既存アプリの互換性の為にBern
もそのまま残してあるとの事です。