2014/10/16分のコミットです。
CHANGELOGへの追加はありませんでした。
Remove duplicate stringify_keys in text_field_tag
actionview/lib/action_view/helpers/form_tag_helper.rb
の修正です。
text_field_tag
メソッドを使用する際、呼び出し元でstringify_keys
メソッドを使用して、hashのkeyをStringクラスに変換していたのですが、text_field_tag
メソッドの中でもstringify_keys
を使用しており、重複しているので、呼び出し元の方のstringify_keys
メソッドを削除しています。
Fix how file_ and password_field_tag edit options
actionview/lib/action_view/helpers/form_tag_helper.rb
の修正です。
file_field_tag
、password_field_tag
メソッドで、引数のoptions
値を追加する際に、update
メソッドを使用していたのをmerge
メソッドを使用するよう修正しています。
Hash#update
だと、selfが変更されてしまうので、以下のように同じオプションを使い回そうとした際に、options
にfile_field_tag
の中で設定した値が反映されてしまうバグがあったようです。
<% options = {class: 'important'} %> <%= file_field_tag 'Upload', options %> <%= text_field_tag 'Name', options %>
Merge pull request #17267 from rebyn/master
activerecord/lib/active_record/associations.rb
、
activerecord/lib/active_record/reflection.rb
の修正です。
has_one associationsに対してthrough
オプションを使用していて、そのthrough
先で polymorphicを使用していた場合に不適切なエラーメッセージが表示されていたのを対応しています。ややこしい…。
Use if/else instead of early raise
activerecord/lib/active_record/reflection.rb
の修正です。
early raiseの代わりに、if/elseを使用するよう修正しています。
- raise HasOneAssociationPolymorphicThroughError.new(active_record.name, self) if has_one? - raise HasManyThroughAssociationPolymorphicThroughError.new(active_record.name, self) + if has_one? + raise HasOneAssociationPolymorphicThroughError.new(active_record.name, self) + else + raise HasManyThroughAssociationPolymorphicThroughError.new(active_record.name, self) + end
Fix typo in actionpack/lib/action_dispatch/routing/mapper.rb
actionpack/lib/action_dispatch/routing/mapper.rb
のdocの修正です。
HtttpHelpers
をHttpHelpers
に修正しています。
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
、
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
の修正です。
schema_definitionsにbigint対応を行っています。
create_table(:foos) do |t| t.bigint :hi end
just look up the primary key from the columns hash
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
の修正です。
primary keyを検索する際、columns
メソッド経由で値を検索していたのを、@columns_hash
から値を検索するよう修正しています。
we don't need a HWIA and a hash allocated for just one k/v pair
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
の修正です。
aliased_types
メソッドでHashWithIndifferentAccess
クラスで変換用の値を定義していたのですが、一つのkey/valueペアの為に、HashWithIndifferentAccess
クラスを生成する必要は無いだろうという事で、処理を修正しています。
- type = aliased_types[type] || type + type = aliased_types(type.to_s, type)
- def aliased_types - HashWithIndifferentAccess.new( - timestamp: :datetime, - ) + def aliased_types(name, fallback) + 'timestamp' == name ? :datetime : fallback end
修正後の方が解りやすいですねえ。
clarify debugger platform invocation
railties/lib/rails/generators/rails/app/templates/Gemfile
の修正です。
byebug
についての説明を追加しています。
use require_command! instead of calling its definition
railties/lib/rails/commands/commands_tasks.rb
の修正です。
各コマンド用のクラスをrequireする際、require_command!
メソッドを使用するよう修正しています。
- require "rails/commands/#{command}" + require_command!(command)
因みに、require_command!
は、require "rails/commands/#{command}"
を実行するだけなので、処理自体は変わってないでようです。
railties/lib/rails/commands/update.rb
を削除しています。
some changelog formatting. [ci skip]
各モジュールのCHANGELOGの修正です。
シングルコーテーションを追加したり、スペース追加したり等フォーマットの修正を行っています。
[ci skip] add AC::InvalidCrossOriginRequest to list of rescue_responses default
rails guideのconfiguring
の修正です。
rescue_responses
のデフォルトの設定の一覧にInvalidCrossOriginRequest
を追加しています。
docs, since #16702 we detect mutation on serialized attributes. [ci skip]
activerecord/lib/active_record/attribute_methods/serialization.rb
のdocの修正です。
serialized attributesについて、現状の仕様とあってない説明を削除しています。
pg, test assigning non-array values to an array column. Closes #14716.
activerecord/test/cases/adapters/postgresql/array_test.rb
の修正です。
PostgreSQLのArray型のカラムに、Arrayじゃない値を設定した場合のテストを追加しています。
4.1より前の場合は、自動でArrayに変換していたらしいのですが、4.1からは変換しなくなっているので、その確認の為にテストを追加したようです。
test, better describe SerializationTypeMismatch
behavior. refs #14716.
activerecord/lib/active_record/attribute_methods/serialization.rb
のdocの修正です。
SerializationTypeMismatch
について、説明を修正しています。
mention the :without option [ci skip]
rails guideのActive Record Validations
の修正です。
format
validatorの説明の箇所に、without
オプションについての説明を追加しています。
test, Generators::GeneratedAttribute
with references, required, index.
railties/test/generators/generated_attribute_test.rb
の修正です。
Generators::GeneratedAttribute
にreferences、required、indexを合わせて指定した場合のテストを追加しています。