2014/07/14分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Fix typos like a html
to an html
and 'an mail' to 'an email'. [ci skip]
各docの修正です。a html
をan html
に、an mail
をan email
に修正しています。
Format pass on 4.2 release notes [ci skip]
guides/source/4_2_release_notes.md
の修正です。
改行の追加、インデントの調整等、見やすさの調整を行っています。
[ci skip] Little bit doc code improvement.
activemodel/lib/active_model/errors.rb
のdocの修正です。サンプルを修正しています。
- # errors.add(:name, "cannot be nil") if name == nil + # errors.add(:name, "cannot be nil") if name.nil?
name.nil?
の方が明確ですね。
Merge pull request #16127 from Envek/fix_16111
activerecord/lib/active_record/schema_dumper.rb
の修正です。
PostgreSQLで、primary keyのデフォルトに、custom functionを使用していた場合に出力内容がおかしかったのを修正しています。
ちょっと解りづらかったので、テストコードから抜粋。
onnection.execute <<-SQL CREATE OR REPLACE FUNCTION my_uuid_generator() RETURNS uuid AS $$ SELECT * FROM uuid_generate_v4() $$ LANGUAGE SQL VOLATILE; SQL # Create such a table with custom function as default value generator connection.create_table('pg_uuids_2', id: :uuid, default: 'my_uuid_generator()') do |t| t.string 'name' t.uuid 'other_uuid_2', default: 'my_uuid_generator()' end
上記のような形でmy_uuid_generator
というFUNCTIONを定義していた場合に、
ActiveRecord::SchemaDumper.dump(connection, schema) assert_match(/\bcreate_table "pg_uuids_2", id: :uuid, default: "my_uuid_generator\(\)"/, schema.string) assert_match(/t\.uuid "other_uuid_2", default: "my_uuid_generator\(\)"/, schema.string)
正しくcreate_table
のSQLが生成されるよう修正されています。
Stash original path in ShowExceptions
middleware
actionpack/lib/action_dispatch/middleware/show_exceptions.rb
の修正です。
ActionDispatch::ShowExceptions#render_exception
メソッドでenv["PATH_INFO"]
をenv["action_dispatch.original_path"]
に格納するよう対応しています。
今までは、ExceptionWrapper
クラスでPATH_INFO
情報を上書きしてしまっていたので、PATH_INFO
を取得するすべが無かったんですね。
Address ORA-00972: identifier is too long when tested with Oracle
ActiveRecordのテストの修正です。
Oracleの識別子(列名)は30byteまでしか指定出来ないらしく、30byte以上の列名があったのを修正しています。
30byteって、意外と短いんですね。