2015/05/28分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Resolve enums in test fixtures
- Clear query cache when
ActiveRecord::Base#relaod
is called. - Add collation support for string and text columns in SQLite3
actionpack/lib/action_controller/metal/rendering.rb
Fix indentation warning on active_support ordered_options
activesupport/lib/active_support/ordered_options.rb
の修正です。
method_missing
メソッドで、 インデントがずれていて下記ワーニング出ていたのを対応しています。
rails/activesupport/lib/active_support/ordered_options.rb:40: warning: mismatched indentations at 'end' with 'if' at 36
Remove web-console and spring from test group on default Gemfile.
railties/lib/rails/generators/rails/app/templates/Gemfile
の集計です。
development
、test
グループ配下に記載してあったweb-console
、spring
をdevelopment
グループ配下のみに修正しています。
web-console
がデフォルトではdevelopment
環境での動作しなくなり、test
グループ配下にあるのはおかしいだろう、という事で修正されたようです。参考: Force development only web console by default by gsamokovarov · Pull Request #134 · rails/web-console
Remove unnecessary reference to example Blog app [ci skip]
rails guideのThe Rails Initialization Process
の修正です。
Back to config/environment.rb
の項で、不要なBlog
appへの言及があったのを削除しています。
railties/lib/rails/tasks/framework.rake
の修正です。
update
タスクの中で、グローバルにメソッドを定義していたのを、新規にRailsUpdate
クラスを作成し、その配下にメソッドを定義するよう修正しています。
[ci skip] Replace dead link about HttpOnly cookies.
rails guideのRuby on Rails Security Guide
の修正です。
既に存在しないha.ckers.org
へのリンクがあったのを、www.owasp.org へのリンクに修正しています。
Merge pull request #19867 from radar/rename-app-rails-loader
railtiesの修正です。
Rails::AppRailsLoader
moduleを Rails::AppLoader
に名前を変更しています。 namespaceをフルに書くと、Rails
と2回入ってしまっており、冗長だろう、という事で修正されたようです。
Merge pull request #19808 from byroot/action-parameter https://github.com/rails/rails/commit/f02f2872426a5973bd2da720f843748d12c11513
actionpack/lib/action_controller/test_case.rb
の修正です。
ActionController::TestRequest
クラスを使用してテストを行った際、パラメータ名にaction
を使用出来なかった問題があったのを、使用出来るよう対応しています。
get
メソッド等にaction
というキーのパラメータを渡すと、強制的にcontrollerのアクション名と判断してしまっていた為、使用出来なくなってしまっていたようです。
railties/test/app_loader_test.rb
の修正です。
Rails::AppRailsLoader
moduleを Rails::AppLoader
に名前を変更した対応で、require方の修正が漏れていたのを対応しています。
railties/lib/rails/cli.rb
の修正です。
先のコミット同様、Rails::AppRailsLoader
moduleを Rails::AppLoader
に名前を変更した対応で、require方の修正が漏れていたのを対応しています。
Resolve enums in test fixtures
activerecord/lib/active_record/fixtures.rb
の修正です。
fixture fileで、enumを使用しているattributeへの値の指定に、symbolを指定出来るよう対応しています。
awdr: title: "Agile Web Development with Rails" status: :proposed
Merge pull request #17654 from kamipo/strict_mode_explicitly
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
の修正です。
If our connection is explicitly non-strict, tell MySQL by matthewd · Pull Request #16065 · rails/rails の対応から、strict
オプションが設定されている/いないに関わらず、sql_mode
が設定されるようになってたのを、 strict
オプションが指定されている場合、sql_mode
を設定しないよう修正しています。
Merge pull request #19886 from henders/henders/reload_wipe_query_cache
activerecord/lib/active_record/persistence.rb
の修正です。
ActiveRecord::Base#relaod
メソッドを呼び出した際、query cacheもクリアーするよう修正しています。
Add application/vnd.api+json alias to the JSON MIME Type.
actionpack/lib/action_dispatch/http/mime_types.rb
の修正です。
JSON MIME typeの一覧にapplication/vnd.api+json
を追加しています。
Add collation support for string and text columns in SQLite3
ActiveRecordのSQLite3 adapterの修正です。
SQLite3のtext
、string
カラムにcollation
オプションを指定出来るよう対応しています。
例。
create_table :foo do |t| t.string :string_nocase, collation: 'NOCASE' t.text :text_rtrim, collation: 'RTRIM' end add_column :foo, :title, :string, collation: 'RTRIM' change_column :foo, :title, :string, collation: 'NOCASE'
Allow Relation#compact using delegation
activerecord/lib/active_record/relation/delegation.rb
の修正です。
Relation#compact
メソッドをArray#compact
にdelegate出来るよう、BLACKLISTED_ARRAY_METHODS
から:compact
を削除しています。
activerecord/test/cases/relation/delegation_test.rb
の修正です。
先のRelation#compact
メソッドの対応のテストを追加しています。
Merge pull request #20263 from arunagw/aa-remove-custom-lines-actionview
actionview/Rakefile
の修正です。
全体の行数を表示する為のrake taskで、独自に行計算のロジックを定義していたのを、既存のCodeTools::LineStatistics
クラスを使用するよう修正しています。
Properly append preload / includes args on Merger
activerecord/lib/active_record/relation/merger.rb
の修正です。
Merger#merge
メソッドでpreload
、includes
メソッドにした値もmerge処理行うよう修正しています。
preload
がmergeされてなかった為、association名が解決出来ず、AssociationNotFoundError
がおきてしまうという問題が起きるケースがあった為追加したとの事です。
issueより例。
class Product < ActiveRecord::Base has_many :variants has_many :translations end class Translation < ActiveRecord::Base belongs_to :product end class Variant < ActiveRecord::Base belongs_to :product end class BugTest < Minitest::Test def test_merge_stuff product = Product.create! name: 'huhu' variant = Variant.create! product_id: product.id Translation.create! locale: 'en', product_id: product.id product_relation = Product.all .preload(:translations) .joins(:translations) .merge(Translation.where(locale: 'en')) .where(name: 'huhu') Variant.joins(:product).merge(product_relation).first # => ActiveRecord::AssociationNotFoundError: Association named 'translations' was not found on Variant; perhaps you misspelled it? end end
Give credit to extra contributor for Base.reload fix
activerecord/CHANGELOG.md
の修正です。
Clear query cache when ActiveRecord::Base#relaod
is called.の説明についてタイポがあったのを修正、及びコントリビューターに協力者の名前を追加しています。
Deprecate :nothing
option for render method
actionpack/lib/action_controller/metal/rendering.rb
の修正です。
render
メソッドのnothing
オプションがdeprecateになりました。
head
メソッドがほぼ同じ動作をするので、response bodyを空にしたい場合は、head
メソッドの方を使用するよう、との事です。
[ci skip] Fix block parameter of assert_no_difference
rails guideのA Guide to Testing Rails Applications
の修正です。
assert_no_difference
メソッドについて説明している箇所で、引数の&block
を&block
にタイポしていたのを修正しています。