2015/08/28分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- PostgreSQL, add
:if_exists
to#drop_schema
. - pg,
create_schema
,drop_schema
andrename_table
quote schema name.
use the non-hash dependent Rack utils API
actionpack/lib/action_dispatch/http/response.rb
の修正です。
cookieをRack utilで管理していたのを、responseクラス内のheader hashで管理するよう修正しています。
implement the API required by the abstract Rack request.
actionpack/lib/action_dispatch/http/response.rb
の修正です。
ActionDispatch::Request
クラスに、header処理に関するメソッド(have_header?
、get_header
、set_header
、delete_header
)を追加しています。
Rack requestから使用する為、ですかねえ。
actionpack/lib/action_dispatch/http/response.rb
の修正です。
rack_response
メソッドから、header[SET_COOKIE]
がString以外の値だった場合の処理を削除しています。
header hashには必ずStringが設定される為、チェックは不要な為との事です。
use the abstract API in modules
actionpack/lib/action_dispatch/http/cache.rb
、
actionpack/lib/action_dispatch/http/filter_redirect.rb
の修正です。
headerの値を参照/設定する際、header hashを直接操作するのではなく、ラッパーメソッド経由で値を操作するよう修正しています。
actionpack/lib/action_dispatch/http/cache.rb
の修正です。
Response
moduleからetag
変数を削除しています。
etagはheader hashで管理しているため、別に変数を持つ必要は無い為、との事です。
remove dependency on @cache_control
ivar
actionpack/lib/action_dispatch/http/cache.rb
の修正です。
set_conditional_cache_control!
メソッドの修正です。
メソッドの引数にcache_control
を追加しています。
元々はインスタンス変数(@cache_control
)直接参照していたのですが、@cache_control
インスタンス変数は削除する予定との事で、メソッドに明示的に値を渡すよう修正しています。
this always sets :public to false, so just do that
actionpack/lib/action_controller/metal/data_streaming.rb
の修正です。
DataStreaming
moduleのsend_file_headers!
メソッドでresponse.cache_control[:public]
に必ずfalseを設定するよう修正しています。
が、これはどうやら誤りらしく、次のコミットでrevertされています。
Revert "this always sets :public to false, so just do that"
actionpack/lib/action_controller/metal/data_streaming.rb
の修正です。
という訳で、先のコミットをrevertしています。
remove link to outdated article in plugins guide [ci skip]
rails guideのThe Basics of Creating Rails Plugins
の修正です。
References
の項にあった、古いブログへのリンクを削除しています。
10X speed improvements for AS::Dependencies.loadable_constants_for_path
activesupport/lib/active_support/dependencies.rb
の修正です。
ActiveSupport::Dependencies.loadable_constants_for_path
メソッドの性能改善の為のリファクタリングを行っています。
PRより。
Benchmark.ips { |x| x.report('baseline') { ActiveSupport::Dependencies.loadable_constants_for_path(File.expand_path('app/models/shop')) }}
# before Calculating ------------------------------------- baseline 90.000 i/100ms ------------------------------------------------- baseline 1.073k (±20.2%) i/s - 4.950k # afer Calculating ------------------------------------- patched 883.000 i/100ms ------------------------------------------------- patched 11.050k (±19.7%) i/s - 50.331k
expanded_root
の値のチェックに正規表現を使用していたのを、String#start_with?
を使用するよう修正、
値が適切じゃなかった場合にearly returnをするよう修正、等の修正を行っているようです。
Merge pull request #21409 from piton4eg/patch-9
rails guideのConfiguring Rails Applications
の修正です。
Configuring Active Record
の項、config.active_record.primary_key_prefix_type
に指定出来る値について説明している箇所のインデントがおかしくなっていたのを、修正しています。
Disable warnings in railties tests
railties/Rakefile
の修正です
railtiesのテストで、rubyのワーニングが表示されないよう設定を変更しています。
sass
を大量のワーニングメッセージを吐くようになってしまい、ログが多くなりすぎる為、表示しないようになったのかなと思われます。
Merge pull request #21396 from rodzyn/code-cleanup
actionpack/lib/action_dispatch/http/parameters.rb
、
actionpack/lib/action_dispatch/http/request.rb
の修正です。
ActionDispatch::Http::Parameters.normalize_encode_params
メソッドを削除して、直接Request::Utils.normalize_encode_params
メソッドを呼び出すよう修正しています。
Action View / Active Supportの修正です。
number_to_currency
、number_with_delimiter
メソッドのオプションに区切り文字を指定する為のdelimiter_pattern
オプションを指定出来るように修正しています。
例。
number_to_currency(1230000, delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/, unit: '₹', format: "%u %n") # => '₹ 12,30,000.00'
インドルピーは2桁目にカンマが入ったりするんですねえ。知らなかった。
fix reference to undefined variable in email testing guide [ci skip]
rails guideのA Guide to Testing Rails Applications
の修正です。
Testing Your Mailers
の項、メール送信テストのexampleコードに誤りがあったのを修正しています。
PostgreSQL, add :if_exists
to #drop_schema
.
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
の修正です。
PostgreSQL adapterのdrop_schema
メソッドに、if_exists
オプションを追加しています。
+ def drop_schema(schema_name, options = {}) + execute "DROP SCHEMA#{' IF EXISTS' if options[:if_exists]} #{schema_name} CASCADE"
存在しないSCHEMAを削除しようとしてエラーになるのを防ぐ為、との事です。
pg docs, connection.tables
does not use the name
argument.
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
のdocの修正です。
tables
メソッドのdocで、search pathにあるschemaか、指定されたschemaのtableのリストを返す、と書いてあるのだが、実際はメソッドの引数のname
は使われておらず、
schemaは指定出来ないので、"指定されたschema"の部分を削除しています。
[Feature] params.require requires array of params
actionpack/lib/action_controller/metal/strong_parameters.rb
の修正です。
ActionController::Parameter#require
メソッドの引数にArrayを指定出来るよう修正しています。
ActionController::Parameters.new(first_name: 'Gaurish', title: nil).require([:first_name, :title]) # => ActionController::ParameterMissing: param is missing or the value is empty: title params = ActionController::Parameters.new(first_name: 'Gaurish', title: Mjallo) first_name, title = params.require([:first_name, :title])
複数keyをrequireをしたい場合、メソッドを別に呼ばなければならなかったので、ちょっと便利になりました。
[ci skip] Better description for starting up with new Rails project
rails guideのGetting Started with Rails
の修正です。
Creating a New Rails Project
の項、guideの進め方について説明している箇所の、言い回しを修正しています。
Tiny documentation improvements [ci skip]
activemodel/lib/active_model/serialization.rb
、
activesupport/lib/active_support/number_helper.rb
のdocの修正です。
1行が80文字に収まるよう適切な位置に改行を追加、グラマーの修正等をまとめて行っています。
pg, create_schema
, drop_schema
and rename_table
quote schema name.
activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
、
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
の修正です。
PostgreSQLのadapterで、create_schema
, drop_schema
, rename_table
各メソッド実行時、引数に指定されたschema名をquoteするよう修正しています。
create_schema("my.schema") # => CREATE SCHEMA "my.schema";
schema名にドットが入っていた場合にエラーになってしまっていたようです。