2017/06/17分のコミットです。
CHANGELOGへの追加はありませんでした。
Merge pull request #29140 from notEthan/log_subscribed_avoid_rescuing
activesupport/lib/active_support/log_subscriber.rb
の修正です。
LogSubscriber::finish
メソッドでlogger
を使用する前にlogger
のインスタンスが生成されているかチェックするよう修正しています。
Add the <app_root>/test
dir to the $LOAD_PATH
as a string:
railties/lib/rails/commands/test/test_command.rb
の修正です。
$LOAD_PATH
にtest directoryがPathname
のobjectとして追加されていたのを、Stringとして追加するよう修正しています。 Rails 5.0まではStringとして追加されており、挙動を合わせる為との事です。
rails guideのThe Asset Pipeline
、Configuring Rails Applications
の修正です。
deprecaredになっていたconfig.assets.raise_runtime_errors
についての説明を削除しています。
Merge pull request #29470 from kamipo/use_nullable_column_instead_of_primary_key
activerecord/test/schema/schema.rb
の修正です。
subscribers
tableでprimary keyとしてid
を使用していたのを、普通のカラムとしてid
を定義するよう修正しています。
- create_table :subscribers, force: true do |t| + create_table :subscribers, id: false, force: true do |t| t.string :nick, null: false t.string :name + t.integer :id
id
カラムをINSERTの際に使用しないテストで使われているのですが、oracle-enhanced adapterだとエラーになってしまう(ActiveRecord::NotNullViolation: OCIError: ORA-01400
がおきてしまう)為、primary keyではなくnullを指定可能な通常のカラムとして定義するようにしたようです。
Merge pull request #29461 from dnl/unscope_where_or
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
or
メソッドに指定するRelationでunscope
を使用したい場合、両方のRelationにor
が無いとエラーになってしまっていたのを、エラーにならないよう修正しています。
# before partial = Post.where("id = 1 and id != 2") partial.or(partial.unscope(:where).where("id = 2")) # => ArgumentError: Relation passed to #or must be structurally compatible. Incompatible values: [:unscope] # after partial = Post.where("id = 1 and id != 2") partial.or(partial.unscope(:where).where("id = 2")) # => Post.where("id = 1 or id = 2")
Merge pull request #29431 from kamipo/fix_create_table_with_query_from_relation
activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb
の修正です。
schema生成時に、RealtionからQueryを生成する、かつ、Relationでbindを使用している場合に、不正なSQL(値のbindが行われない)が生成されてしまうバグがあったのを修正しています。
Merge pull request #29392 from alexcameron89/unpersisted_create_association
activerecord/lib/active_record/associations/singular_association.rb
の修正です。
parentがsaveされてない状態でsingular associationのcreate処理を呼び出した場合に、エラー(ActiveRecord::RecordNotSaved
)をraiseするよう修正しています。
firm = Firm.new firm.create_account # => ActiveRecord::RecordNotSaved
Remove FK together with column in MySQL
activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb
の修正です。
MySQL adapterのremove_column
メソッドで、カラムを削除する際に外部キー制約も合わせて削除するよう修正しています。
Merge pull request #29415 from kamipo/remove_unused_defined_association
activerecord/test/models/comment.rb
の修正です。
Comment
クラスから使用していないdeveloper
assocationを削除しています。
[ci skip] Update fedora SQLite3 package name
rails guideのDevelopment Dependencies Install
の修正です。
Set up and Run the Tests
の項、sqlite3のパッケージ名を修正しています。