2015/12/18分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Extract support for the legacy
mysql
database adapter from core. It will live on in a separate gem for now, but most users should just usemysql2
. - Ignore index name in
index_exists?
andremove_index
when not passed a name to check for. - Support passing the schema name as a prefix to table name in
ConnectionAdapters::SchemaStatements#indexes
. Previously the prefix would be considered a full part of the index name, and only the schema in the current search path would be considered. - Omit default limit values in dumped schema. It's tidier, and if the defaults change in the future, we can address that via Migration API Versioning.
- Order the result of
find(ids)
to match the passed array, if the relation has no explicit order defined.
Generate API doc for actioncable
railties/lib/rails/api/task.rb
の修正です。
Action Cableのapi docが生成されるようdoc生成用の処理を追加しています。
Add actioncable to list of release frameworks [ci skip]
tasks/release.rb
の修正です。
release用taskのリストに、Action Cableを追加しています。
Fix typo in thread_mattr_accessor doco [ci skip]
activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb
のdocの修正です。
DHH
をCHH
にタイポしている箇所があったのを修正していいます。
Use Thread.current.thread_variable_set/get insetad of the direct accessors
activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb
の修正です。
thread変数を取得/設定するのに、#[]
、#[]=
メソッドを使用していたのを、#thread_variable_get
、#thread_variable_set
メソッドを使用するよう修正しています。
actioncable/lib/rails/generators/channel/USAGE
の修正です。
channel
をchanel
にタイポしている箇所があったのを修正しています。
Copy-edit the Per Thread attribute accessor documentation
activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb
のdocの修正です。
#thread_mattr_reader
、#thread_mattr_writer
のexampleで、#[]
、#[]=
メソッドを使用していたのを、#thread_variable_get
、#thread_variable_set
メソッドを使用するよう修正しています。
Use FRAMEWORKS constant from tasks/release
to avoid duplication
Rakefile
の修正です。
railsのframeworkの一覧を定義するのに、PROJECTS
という定数を使用していたのですが、既に同じ値を定義したFRAMEWORKS
定数があったので、そちらを使用するよう修正しています。
Use released turbolinks in the test suite
Gemfile
の修正です。
rails本体のテストで、最新のturbolinksを使用していたのを、gemとしてリリースされているturbolinksを使用するよう修正しています。
Clarify thread_mattr_accessor subclass behavior documentation
activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb
のdocの修正です。
thread_mattr_accessor
使用したクラスの子クラスでの振る舞いについて説明を追加しています。
Remove warnings from actioncable
Action Cableの修正です。
Actio Cable のコード / テストのあちこちでRubyのワーニングが出てしまっていたのを、まとめて修正しています。
Call the new point behavior :point
, not :rails_5_1_point
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
、
activerecord/lib/active_record/model_schema.rb
の修正です。
PostgreSQLのpoint
型をArrayにマッピングしていた際に出力するエラーメッセージで、:rails_5_1_point
を使用するよう表示していたのを、:point
を使用するよう修正しています。
Expanding the documentation for collection=objects for has_many :through [ci-skip]
activerecord/lib/active_record/associations.rb
のdocの修正です。
has_many
メソッドについて説明している箇所で、collection=objects
を指定した場合のケースで、オブジェクトを削除したくない場合、dependent
オプションを設定する旨の説明を追加しています。
traditional make sense with <tt>ActiveSupport::TaggedLogging</tt>
actioncable/lib/action_cable/connection/tagged_logger_proxy.rb
の修正です。
ActionCable::Connection::TaggedLoggerProxy
クラスのdocで、traditional
をtradional
にタイポしていたのを修正、及びクラス名がタイプライター体で表示されるよう、<tt>
を追加しています。
Gemfile
の修正です。
mail
gemの指定にgithubを指定していたのを削除し、gemとしてリリースされているmail
を使用するよう修正しています。
[ci skip] Add Thread.current
to match internals
activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb
のdocの修正です。
doc内のexampleで#thread_variable_get
、#thread_variable_set
を呼び出す際、#current
でカレントスレッドを指定してから呼び出すよう修正しています。
- # Thread.thread_variable_set("attr_Current_user", "DHH") + # Thread.current.thread_variable_set("attr_Current_user", "DHH")
Rubyのdocに書いてあるexampleに合わせた為のようです。
railties/test/application/assets_test.rb
の修正です。
assetsについてのテストで、Rubyのワーニングが出ていたのを、丸括弧を追加して対応しています。
- assert_match /Post;/, File.read(Dir["#{app_path}/public/assets/application-*.js"].first) + assert_match(/Post;/, File.read(Dir["#{app_path}/public/assets/application-*.js"].first))
ApplicationMailer should be generated by default just like every other Application* parent
Gemfile
の修正です。
arel
gemの指定にgithubを指定していたのを削除し、gemとしてリリースされているarel
を使用するよう修正しています。
Merge pull request #22627 from rails/application-mailer-by-default
railtiesの修正です。
rails new
した際に、mailer用の親クラスであるApplicationMailer
クラスを生成してしまうよう修正しています。
他の親クラス(ApplicationController
、ApplicationRecord
等)と挙動を合わせる為、との事です。
Gemfile
の修正です。
jquery-rails
gemの指定にgithubを指定していたのを削除し、gemとしてリリースされているjquery-rails
を使用するよう修正しています。
Gemfile
の修正です。
sprockets-rails
gemの指定にgithubを指定していたのを削除し、gemとしてリリースされているsprockets-rails
を使用するよう修正しています。
Don't log Action Cable to STDOUT in development
actioncable/lib/action_cable/process/logging.rb
、
actioncable/lib/action_cable/server/configuration.rb
の修正です。
development
envの場合に、Action CableのログがSTDOUTに2回出力されてしまっていたのを、一度だけ出力されるよう修正しています。
Should also stub the received callback
actioncable/lib/rails/generators/channel/templates/assets/channel.coffee
の修正です。
generatorsが生成するchanel用のcoffee scriptにreceived
callbackを定義するよう修正しています。
あれ、もうgeneratorあるのか。勘違いしていた…。
Only dup Ruby's Hash and Array.
actionpack/lib/action_controller/metal/strong_parameters.rb
の修正です。
ActionController::Parameters#to_h
、ActionController::Parameters#to_unsafe_h
メソッドで引数のdeep_dup
を行っていたのを、引数をチェックし、引数がHash、Array、Parametersの場合のみdup処理を行うよう修正しています。
Active Record modelを引数に渡した場合に、うっかりdupを生成されるのを防ぐ為、との事です。
Gemfile
の修正です。
使用するNokogiri
のバージョンを1.6.7.1
を以上するよう修正しています。
1.6.7.1
でCVEに対応されている為との事です。参考:[ANN] nokogiri security update - 1.6.7.1 - Google グループ
Use released GlobalID now that it provides URI::GID::MissingModelIdError for Active Job
Gemfile
、activejob/activejob.gemspec
の修正です。
globalid
gemの指定にgithubを指定していたのを削除し、gemとしてリリースされているglobalid
を使用するよう修正しています。
合わせて、使用するglobalid
のバージョンを0.3.0
以上から、0.3.6
以上に修正しています。
URI::GID::MissingModelIdError
を使用する為、との事です。
Document when fallback_location is used [ci-skip]
actionpack/lib/action_controller/metal/redirecting.rb
のdocの修正です。
redirect_back
メソッドのdocにどのような場合にfallback_location
オプションが使用されるかについての説明を追加しています。
Merge pull request #22642 from seuros/remove-mysql-adapter
Active Recordの修正です。
rails本体から、mysql
adapterに関する処理が削除され、gemに切り出されました。
gemを使用すれば今後もmysql
adapterを使用する事は出来るのですが、基本的にはmysql2
の方を使用する事が推奨される、との事です。
Merge pull request #19456 from greysteil/index-exists-behaviour
Active Recordの修正です。
#index_exists?
、#remove_index
メソッドで、name
オプションを渡さなかった場合に、デフォルトの生成ルールのインデックス名しかチェックしてなかったのを、任意のインデックス名を使用した場合も正しくチェックするよう修正しています。
PRより。
# table: "testings", column: "foo", index: "custom_index_name"があった場合 # before connection.index_exists?(:testings, :foo) #=> false connection.index_exists?(:testings, :foo, name: "custom_index_name") #=> true # after connection.index_exists?(:testings, :foo) #=> true connection.index_exists?(:testings, :foo, name: "custom_index_name") #=> true
Merge pull request #22623 from greysteil/support-passing-schema-name-to-indexes
Active Recordの修正です。
ConnectionAdapters::SchemaStatements#indexes
メソッドの引数のテーブル名に、スキーマ名を指定出来るよう修正しています。
Merge pull request #21914 from zachalewel/zachalewel-patch-1
actionview/CHANGELOG.md
の修正です。
CHANGELOGのグラマー、フォーマットの修正を行っています。
Merge pull request #20815 from byroot/do-not-include-column-limit-if-it-is-default
activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb
の修正です。
limit
の値と、型のデフォルトの値とが一致した場合に、schemaファイルにlimit
の値を出力しないよう修正しています。
複数のDBに対応しようとした場合に、limit
の値が邪魔になってしまう事がある為、との事です。
たとえば、MySQLでbooleanのカラムをダンプした場合、以下のような情報が出力されます。
t.boolean 'foo', limit: 1
が、この情報をそのままPostgresにインポートしようとすると、syntax errorになってしまいます。
こういう事が発生するのを防ぐ為、との事なのですが…。うーん。
activerecord/test/cases/adapters/mysql2/charset_collation_test.rb
、
activerecord/test/cases/adapters/mysql2/unsigned_type_test.rb
の修正です。
先の対応により出力されなくなったlimit
をテストから削除しています。
Merge pull request #22653 from matthewd/find_array_ordered
Active Recordの修正です。
#find
メソッドにidのArrayを渡した場合に、そのidの順番通りに結果が返ってくるよう修正しています。
records = Topic.find([4,2,5]) records[0].id #=> 4 records[1].id #=> 2 records[2].id #=> 5
Gemfile
の修正です。
rails用のGemfileにjquery-rails
を追加しています。
先ほど削除されたのですが、テストの中で使用している為(rails app自身を生成するテストがあり、そこで使用している)、戻しています
actioncable/lib/action_cable/channel/base.rb
のdocの修正です。
a
をan
にタイポしている箇所があったのを修正しています。
Gemfile
、railties/lib/rails/generators/app_base.rb
の修正です。
rack
gemの指定にgithubを指定していたのを削除し、gemとしてリリースされているrack
を使用するよう修正しています。
Ignore Byebug command history file
railties/lib/rails/generators/rails/app/templates/gitignore
の修正です。
gitignoreの対象に.byebug_history
を追加しています。
fix indentation of generated controller test
railties/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb
、
railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
の修正です。
生成されるcontroller testファイルのindentがおかしくなっていたのを修正しています。
Revert "Use Thread.current.thread_variable_set/get insetad of the direct accessors"
https://github.com/rails/rails/commit/33e11e59cce582c6b866df2e97477701c30cede1
thread変数を取得/設定するのに、#[]
メソッドを使用していたのを、#thread_variable_get
、#thread_variable_set
メソッドを使用するよう修正した、
Use Thread.current.thread_variable_set/get insetad of the direct accessors をrevertしています。
#thread_variable_set
だと、#[]
と異なり、セットした変数はFiberを切り替えても共通で使えてしまう、という仕様があり、Fiberを使用している場合に問題になってしまう為、#[]
を使用するよう修正しています。
参考:instance method Thread#[] (Ruby 2.2.0)
List the major frameworks you can remove together
railties/lib/rails/generators/app_base.rb
の修正です。
class_option :skip_action_cable
の位置を、他のコンポーネントと同じ並び(skip_active_record
の後)に移動しています。
More sensible ordering with the more important options first
railties/lib/rails/generators/app_base.rb
の修正です。
class_option
の並びを重要と思われる順番に並び替えています。
README.md in the app is now used to describe the app itself, not Rails
railties/lib/rails/generators/rails/app/USAGE
の修正です。
rails new
のUSAGEに、railsについての詳細は生成されるREADMEを参照して、という記載があったのですが、生成されるREADMEにはappの情報のみ記載されており、rails自体についての説明は無かった為、該当の記載を削除しています。
Use the rails command, not rake, for all rails commands
railties/lib/rails/generators/rails/app/templates/bin/setup
、
railties/lib/rails/generators/rails/app/templates/bin/update
の修正です。
各rakeタスクを実行するのにrake
コマンドを使用していたのを、rails
コマンドを使用するよう修正しています。
- system! 'ruby bin/rake db:setup' + system! 'bin/rails db:setup'
railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee
のdocの修正です。
生成されるcable.coffee
のdocに、Action Cable自体についての説明を追加しています。
These options are not changed nearly often enough to warrant inclusion like this at a high level
railties/lib/rails/generators/rails/app/templates/config/application.rb
の修正です。
rails new
で生成されるapplication.rb
からconfig.time_zone
、config.i18n.load_path
及びconfig.i18n.default_locale
オプションについての説明を削除しています。
そんなに頻繁に更新するオプションでは無いだろう、との事で削除されたようです。
railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
の修正です。
config.consider_all_requests_local
を設定している箇所に、不要なスペースがあったのを削除しています。
Explain the concept of config initializers for backwards compatibility
rails/railties/lib/rails/generators/rails/app/templates/config/initializers/active_record_belongs_to_required_by_default.rb
、
rails/railties/lib/rails/generators/rails/app/templates/config/initializers/callback_terminator.rb
、
rails/railties/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb
のdocの修正です。
上記新規に作成されたinitializerに、これらのinitializerはRails 5のデフォルトであり、アップグレード時には影響無い旨説明を追加しています。
Bring comment in line with rest of initializers
rails/railties/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb
のdocの修正です。
ファイルの先頭に、ファイルを更新した場合にserverの再起動が必要な旨説明を追加しています。
Merge pull request #22656 from akshay-vishnoi/fix-typos
Action Cableの各docの修正です。
各docのグラマーの修正を行っております。
[ci skip] Revert most of ff851017
activesupport/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb
のdocの修正です。
#thread_mattr_reader
、#thread_mattr_writer
のexampleで、#thread_variable_get
、#thread_variable_set
メソッドを使用していたのを、#[]
、#[]=
を使用するよう修正しています。
Explain Redis' role in Action Cable
railties/lib/rails/generators/rails/app/templates/config/redis/cable.yml
の修正です。
cable.yml
の先頭にAction CableにおけるRedisの役割についての説明を追加しています。
Explain reason for eager loading
railties/lib/rails/generators/rails/app/templates/config.ru.tt
の修正です。
デフォルトで生成されるconfig.ru
に、何故Rails.application.eager_load!
を呼び出しているかの説明を追加しています。
Refer to rails command instead of rake in a bunch of places
各doc、コードの修正です。
rake
コマンドを使用していた箇所を、全てrails
コマンドを使用するよう修正しています。
actioncable/README.md
の修正です。
Action Cableのexampleで、requireするJSのファイル名が誤っていたのを修正しています。
actioncable/README.md
の修正です。
Action Cableのredisの設定ファイルのexampleで、エイリアスを使って重複した項目を省略出来るよう修正しています。
actioncable/README.md
の修正です。
Terminology
の項の言い回しを修正しています。
Same gemspec formats everywhere
actioncable/actioncable.gemspec
、actionmailer/actionmailer.gemspec
の修正です。
gemspecのフォーマットを統一するよう修正しています。
Merge pull request #22657 from matthewd/loosen-version
railties/lib/rails/generators/app_base.rb
、
railties/lib/rails/generators/rails/plugin/templates/%name%.gemspec
、
railties/lib/rails/generators/rails/plugin/templates/Gemfile
の修正です。
rails pluginでrailsのバージョンを指定する際、PATCH versionまで固定していたのを、PATCHバージョンの変更までは許容するよう修正しています。
例えば、railsのバージョンが4.1.13
だった場合、Gemfileのバージョン指定は~> 4.1.13
になるようになっています。
[ActionCable] Test available actions on Channel
actioncable/test/channel/base_test.rb
の修正です。
channelのaction methodについて確認するテストを追加しています。
Do not check the version anymore
railties/test/generators/plugin_generator_test.rb
の修正です。
plugin generatorのテストで、生成されたgemspecに関するテストから、railsのバージョンチェックのテストを削除しています。
先ほどのバージョン指定の対応により生成されるバージョンが複雑になり、またバージョン指定のテストは別の箇所にもある為、との理由で、generatorのテストからは削除されています。
Merge pull request #22660 from y-yagi/add_line_break_between_methods
actioncable/lib/rails/generators/channel/templates/assets/channel.coffee
の修正です。
メソッド名を複数指定してchannelをgenerateした際、channel.coffeeでメソッド間が詰まっていたのを、間に改行を入れるよう修正しています。
Merge pull request #20797 from byroot/prevent-url-for-ac-parameters
actionpack/lib/action_controller/metal/redirecting.rb
、
actionpack/lib/action_dispatch/routing/url_for.rb
の修正です。
#url_for
メソッドの引数permitされていないActionController::Parameters
が指定された場合に、ArgumentError
をraiseするよう修正しています。
permitされてないActionController::Parameters
をAction Dispatchの中で参照されないようにする為に、早々にエラーをraiseするようにしたようです。
Merge pull request #22650 from derekprior/dp-actionpack-warnings
actionpack/test/assertions/response_assertions_test.rb
の修正です。
assert_response
のテストで、@controller
、@request
が定義されていない事によるRubyのワーニングが表示されてしまっていたので、インスタンス変数の定義処理追加して対応しています。